<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libxlsxwriter: Working with Charts</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libxlsxwriter
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title">Working with Charts </div>  </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#ww_charts_axes">Chart Value and Category Axes</a></li>
<li class="level1"><a href="#chart_markers">Working with Chart Markers</a></li>
<li class="level1"><a href="#chart_trendlines">Working with Chart Trendlines</a></li>
<li class="level1"><a href="#chart_error_bars">Working with Chart Error Bars</a></li>
<li class="level1"><a href="#chart_points">Working with Chart Points</a></li>
<li class="level1"><a href="#chart_labels">Working with Chart Data Labels</a><ul><li class="level2"><a href="#chart_custom_labels">Custom Chart Data Labels</a></li>
</ul>
</li>
<li class="level1"><a href="#chart_formatting">Chart Formatting</a><ul><li class="level2"><a href="#chart_fonts">Chart formatting: Fonts</a></li>
<li class="level2"><a href="#chart_lines">Chart formatting: Line</a></li>
<li class="level2"><a href="#chart_borders">Chart formatting: Border</a></li>
<li class="level2"><a href="#chart_fills">Chart formatting: Fill</a></li>
<li class="level2"><a href="#chart_patterns">Chart formatting: Pattern</a></li>
</ul>
</li>
<li class="level1"><a href="#ww_charts_limitations">Chart Limitations</a></li>
</ul>
</div>
<div class="textblock"><p>This section explains how to work with some of the options and features of <a class="el" href="chart_8h.html">The Chart object</a>.</p>
<p>The majority of the examples in this section are based on a variation of the following program:</p>
 <div class="fragment"><div class="line"><span class="keywordtype">int</span> main() {</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="structlxw__workbook.html">lxw_workbook</a>  *workbook  = <a class="code" href="workbook_8h.html#a1cf96608a23ee4eb0e8467c15240d00b">workbook_new</a>(<span class="stringliteral">&quot;chart_line.xlsx&quot;</span>);</div>
<div class="line">    <a class="code" href="structlxw__worksheet.html">lxw_worksheet</a> *worksheet = <a class="code" href="workbook_8h.html#a81d456b4f65a464e78e4a0030ecc3c2e">workbook_add_worksheet</a>(workbook, NULL);</div>
<div class="line">    <a class="code" href="structlxw__chart.html">lxw_chart</a> *chart;</div>
<div class="line">    <a class="code" href="structlxw__chart__series.html">lxw_chart_series</a> *series;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Write some data for the chart. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 0, 0, 10, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 1, 0, 40, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 2, 0, 50, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 3, 0, 20, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 4, 0, 10, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, 5, 0, 50, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create a chart object. */</span></div>
<div class="line">    chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85caf309b18af571c90d3ae052e769d30e6c">LXW_CHART_LINE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Configure the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, NULL, <span class="stringliteral">&quot;Sheet1!$A$1:$A$6&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    (void)series; <span class="comment">/* Do something with series in the real examples. */</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac2067faaacb8bfa6550b019e915900a2">worksheet_insert_chart</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;C1&quot;</span>), chart);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> <a class="code" href="workbook_8h.html#ad9e7aeebc0fd43562db5bcd527b2ee5e">workbook_close</a>(workbook);</div>
<div class="line">}</div>
</div><!-- fragment --><div class="image">
<img src="chart_working.png" alt=""/>
</div>
<h1><a class="anchor" id="ww_charts_axes"></a>
Chart Value and Category Axes</h1>
<p>When working with charts it is important to understand how Excel differentiates between a chart axis that is used for series categories and a chart axis that is used for series values.</p>
<p>In the majority of Excel charts the X axis is the <b>category</b> axis and each of the values is evenly spaced and sequential. The Y axis is the <b>value</b> axis and points are displayed according to their value:</p>
<div class="image">
<img src="chart_axes01.png" alt=""/>
</div>
<p>Excel treats these two types of axis differently and exposes different properties for each. For example, here are the properties for a category axis:</p>
<div class="image">
<img src="chart_axes02.png" alt=""/>
</div>
<p>Here are properties for a value axis:</p>
<div class="image">
<img src="chart_axes03.png" alt=""/>
</div>
<p>As such, some of the <code>libxlsxwriter</code> axis properties can be set for a value axis, some can be set for a category axis and some properties can be set for both. The documentation calls out the type of axis to which functions apply and the API emits a warning if the wrong type is used.</p>
<p>Some category axes, such as the one in the column chart example above, use numbers as the categories. However, these numbers can't be treated like value axes. In particular you can't use <a class="el" href="chart_8h.html#a9339204d64e055adef0302115b5e4281" title="Set the maximum value for a chart axis.">chart_axis_set_max()</a> and <a class="el" href="chart_8h.html#a709657333cfdaf12066fa2bf68e92663" title="Set the minimum value for a chart axis.">chart_axis_set_min()</a> for category axes, as you can see in the respective format dialogs above.</p>
<p>For a Bar chart the Category and Value axes are reversed:</p>
<div class="image">
<img src="chart_axes04.png" alt=""/>
</div>
<p>A Scatter chart (but not a Line chart) has 2 value axes:</p>
<div class="image">
<img src="chart_axes05.png" alt=""/>
</div>
<dl class="section note"><dt>Note</dt><dd>Date axes aren't supported yet.</dd></dl>
<h1><a class="anchor" id="chart_markers"></a>
Working with Chart Markers</h1>
<p>In Excel a chart marker is used to distinguish data points in a plotted series. In general only Line and Scatter and Radar chart types use markers. The libxlsxwriter chart types that can have markers are:</p>
<ul>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85caf309b18af571c90d3ae052e769d30e6c">LXW_CHART_LINE</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cac67f7cb8fb0cdd98b0e3d8ecd7c5cd4e">LXW_CHART_SCATTER</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85ca2c790940adb04ba5030a3fb1cf9a4c83">LXW_CHART_SCATTER_STRAIGHT</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85ca4629ad350ebcdb6f98e1ce8b3c0bdcfa">LXW_CHART_SCATTER_STRAIGHT_WITH_MARKERS</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cabc16d4ec606d150661855b2252565506">LXW_CHART_SCATTER_SMOOTH</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85ca50cf4163e4a7b146771ff7dd180ae4c1">LXW_CHART_SCATTER_SMOOTH_WITH_MARKERS</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85ca700d2ed934b73997dc030c6f5f652b58">LXW_CHART_RADAR</a></li>
<li><a class="el" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85cae7bc22beb8b3f55a83f7ea8df896b595">LXW_CHART_RADAR_WITH_MARKERS</a></li>
</ul>
<p>The chart types with <code>MARKERS</code> in the name have markers with default colors and shapes turned on by default but it is possible to change them using the functions shown below.</p>
<p>The <code><a class="el" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5" title="Set the data marker type for a series.">chart_series_set_marker_type()</a></code> function is used to specify the type of the series marker:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca06f870f503d97d50c1177e526208f699">LXW_CHART_MARKER_DIAMOND</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_marker1.png" alt=""/>
</div>
<p>The available marker types defined by <a class="el" href="chart_8h.html#acd6eb4c69474ee4730c82f94d0316af7" title="Chart marker types.">lxw_chart_marker_type</a> are:</p>
<ul>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca3575e2c5d289739b8c5b825c13893ff7">LXW_CHART_MARKER_AUTOMATIC</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca8034b60b42094dd1a919e1432828b9ce">LXW_CHART_MARKER_NONE</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcac09f924f33e8068a175686cd968332a1">LXW_CHART_MARKER_SQUARE</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca06f870f503d97d50c1177e526208f699">LXW_CHART_MARKER_DIAMOND</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcac3a481d6a7ac1692534f4aa11844d079">LXW_CHART_MARKER_TRIANGLE</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcaf1080c66bda7fc7187e4a3a11fc0e932">LXW_CHART_MARKER_X</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca5c3a72be3c3d0efd34094e60d7923505">LXW_CHART_MARKER_STAR</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca5aa2f487e343e75450446513a2721155">LXW_CHART_MARKER_SHORT_DASH</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca7ef8beb0f980685042ca4bb4a4ffcf43">LXW_CHART_MARKER_LONG_DASH</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca0ae3b0b530833d7a3e5315d72467f6ce">LXW_CHART_MARKER_CIRCLE</a></li>
<li><a class="el" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcaa9f2c3cdf377e735475ba0831b5e8c34">LXW_CHART_MARKER_PLUS</a></li>
</ul>
<p>The <code>#LXW_CHART_MARKER_NONE</code> type can be used to turn off default markers:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca8034b60b42094dd1a919e1432828b9ce">LXW_CHART_MARKER_NONE</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_series_set_marker_none.png" alt=""/>
</div>
<p>The <code>#LXW_CHART_MARKER_AUTOMATIC</code> type is a special case which turns on a marker using the default marker style for the particular series. If automatic is on then other marker properties such as size, line or fill cannot be set.</p>
<p>The <code><a class="el" href="chart_8h.html#a9f90731ea7f0ff224a19315604ce2acb" title="Set the size of a data marker for a series.">chart_series_set_marker_size()</a></code> function is used to specify the size of the series marker:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca0ae3b0b530833d7a3e5315d72467f6ce">LXW_CHART_MARKER_CIRCLE</a>);</div>
<div class="line"><a class="code" href="chart_8h.html#a9f90731ea7f0ff224a19315604ce2acb">chart_series_set_marker_size</a>(series, 10);</div>
</div><!-- fragment --><div class="image">
<img src="chart_series_set_marker_size.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#a416463dd44486e6b6a23209789a3642e" title="Set the line properties for a chart series marker.">chart_series_set_marker_line()</a></code> and <code><a class="el" href="chart_8h.html#a73af3ba49f013b2a12ecfe15b7ba50c7" title="Set the fill properties for a chart series marker.">chart_series_set_marker_fill()</a></code> functions can be used to set the line/border and fill properties of a chart marker:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcac09f924f33e8068a175686cd968332a1">LXW_CHART_MARKER_SQUARE</a>);</div>
<div class="line"><a class="code" href="chart_8h.html#a9f90731ea7f0ff224a19315604ce2acb">chart_series_set_marker_size</a>(series, 8);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a416463dd44486e6b6a23209789a3642e">chart_series_set_marker_line</a>(series, &amp;line);</div>
<div class="line"><a class="code" href="chart_8h.html#a73af3ba49f013b2a12ecfe15b7ba50c7">chart_series_set_marker_fill</a>(series, &amp;fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_marker2.png" alt=""/>
</div>
<p>For more information on line/border and fill formatting see <a class="el" href="working_with_charts.html#chart_lines">Chart formatting: Line</a> and <a class="el" href="working_with_charts.html#chart_fills">Chart formatting: Fill</a> below.</p>
<h1><a class="anchor" id="chart_trendlines"></a>
Working with Chart Trendlines</h1>
<p>A trendline can be added to a chart series to indicate trends in the data such as a moving average or a polynomial fit. The trendlines types are shown in the following Excel dialog:</p>
<div class="image">
<img src="chart_trendline0.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d" title="Turn on a trendline for a chart data series.">chart_series_set_trendline()</a></code> function turns on these trendlines for a data series:</p>
<div class="fragment"><div class="line">chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85caf309b18af571c90d3ae052e769d30e6c">LXW_CHART_LINE</a>);</div>
<div class="line">series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, NULL, <span class="stringliteral">&quot;Sheet1!$A$1:$A$6&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline2.png" alt=""/>
</div>
<p>The <code>value</code> parameter corresponds to <em>order</em> for a polynomial trendline and <em>period</em> for a Moving Average trendline. It both cases it must be &gt;= 2. The <code>value</code> parameter is ignored for all other trendlines:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1ab260b3815f45cbea6ce2b7c0d19157b3">LXW_CHART_TRENDLINE_TYPE_AVERAGE</a>, 2);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline3.png" alt=""/>
</div>
<p>The allowable values for the the trendline <code>type</code> are:</p>
<ul>
<li><a class="el" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>: Linear trendline.</li>
<li><a class="el" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a6182fcff33df52fc8fdeeb64a14d3e13">LXW_CHART_TRENDLINE_TYPE_LOG</a>: Logarithm trendline.</li>
<li><a class="el" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a93bf93434b12f928eed686da2cf50b9b">LXW_CHART_TRENDLINE_TYPE_POLY</a>: Polynomial trendline. The <code>value</code> parameter corresponds to <em>order</em>.</li>
<li><a class="el" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a982a6397c9a9713d2474c2ab1fba1b51">LXW_CHART_TRENDLINE_TYPE_POWER</a>: Power trendline.</li>
<li><a class="el" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1aa8fc1ac6643c99a034a4f73047c9286f">LXW_CHART_TRENDLINE_TYPE_EXP</a>: Exponential trendline.</li>
<li><a class="el" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1ab260b3815f45cbea6ce2b7c0d19157b3">LXW_CHART_TRENDLINE_TYPE_AVERAGE</a>: Moving Average trendline. The <code>value</code> parameter corresponds to <em>period</em>.</li>
</ul>
<p>Other trendline options, such as those shown in the following Excel dialog, can be set using the functions described below.</p>
<div class="image">
<img src="chart_trendline1.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#a401668a7c3f88fad6a6c3631a5620f61" title="Set the trendline forecast for a chart data series.">chart_series_set_trendline_forecast()</a></code> function sets the forward and backward forecast periods for the trendline:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"><a class="code" href="chart_8h.html#a401668a7c3f88fad6a6c3631a5620f61">chart_series_set_trendline_forecast</a>(series, 0.5, 0.5);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline4.png" alt=""/>
</div>
<dl class="section note"><dt>Note</dt><dd>This feature isn't available for Moving Average in Excel.</dd></dl>
<p>The <code><a class="el" href="chart_8h.html#a9ce06ada55f8341e3e12559c38e5df9d" title="Display the equation of a trendline for a chart data series.">chart_series_set_trendline_equation()</a></code> function displays the equation of the trendline on the chart:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"><a class="code" href="chart_8h.html#a9ce06ada55f8341e3e12559c38e5df9d">chart_series_set_trendline_equation</a>(series);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline5.png" alt=""/>
</div>
<dl class="section note"><dt>Note</dt><dd>This feature isn't available for Moving Average in Excel.</dd></dl>
<p>The <code><a class="el" href="chart_8h.html#a85cee89620705cec1c3f705d30ce5fe5" title="Display the R squared value of a trendline for a chart data series.">chart_series_set_trendline_r_squared()</a></code> function displays the R-squared value for the trendline on the chart:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"><a class="code" href="chart_8h.html#a85cee89620705cec1c3f705d30ce5fe5">chart_series_set_trendline_r_squared</a>(series);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline6.png" alt=""/>
</div>
<dl class="section note"><dt>Note</dt><dd>This feature isn't available for Moving Average in Excel.</dd></dl>
<p>The <code><a class="el" href="chart_8h.html#a542deffbda8d6be959401c936d821e11" title="Set the trendline Y-axis intercept for a chart data series.">chart_series_set_trendline_intercept()</a></code> function sets the Y-axis intercept for the trendline:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"><a class="code" href="chart_8h.html#a9ce06ada55f8341e3e12559c38e5df9d">chart_series_set_trendline_equation</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#a542deffbda8d6be959401c936d821e11">chart_series_set_trendline_intercept</a>(series, 0.8);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline7.png" alt=""/>
</div>
<p>As can be seen from the equation on the chart the intercept point (when X=0) is the same as the value set in the equation.</p>
<dl class="section note"><dt>Note</dt><dd>The intercept feature is only available in Excel for Exponential, Linear and Polynomial trendline types.</dd></dl>
<p>The <code><a class="el" href="chart_8h.html#a3da2fd3d4dd9d223251584494a946cb7" title="Set the trendline name for a chart data series.">chart_series_set_trendline_name()</a></code> function sets the name of the trendline that is displayed in the chart legend. In the examples above the trendlines are displayed with default names like "Linear (Series 1)" and "2 per Mov. Avg. (Series 1)". If these names are too verbose or not descriptive enough you can set your own trendline name:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"><a class="code" href="chart_8h.html#a3da2fd3d4dd9d223251584494a946cb7">chart_series_set_trendline_name</a>(series, <span class="stringliteral">&quot;My trendline&quot;</span>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline8.png" alt=""/>
</div>
<p>It is often preferable to turn off the trendline caption in the legend. This is done in Excel by deleting the trendline name from the legend. In libxlsxwriter this is done using the <code><a class="el" href="chart_8h.html#ac22638faf2a6168d23af1969fcaa0612" title="Remove one or more series from the the legend.">chart_legend_delete_series()</a></code> function to delete the zero based series numbers:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Delete the series name for the second series (=1 in zero base).</span></div>
<div class="line"><span class="comment">// The -1 value indicates the end of the array of values.</span></div>
<div class="line">int16_t names[] = {1, -1};</div>
<div class="line"><a class="code" href="chart_8h.html#ac22638faf2a6168d23af1969fcaa0612">chart_legend_delete_series</a>(chart, names);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline9.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#ab815412fe8d862efaa8c932df4923178" title="Set the trendline line properties for a chart data series.">chart_series_set_trendline_line()</a></code> function is used to set the line properties of a trendline:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a>     = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>,</div>
<div class="line">                       .dash_type = <a class="code" href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570a913ea1b36ac420c9acf302f6edef768a">LXW_CHART_LINE_DASH_LONG_DASH</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a>(series, <a class="code" href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a>, 0);</div>
<div class="line"><a class="code" href="chart_8h.html#ab815412fe8d862efaa8c932df4923178">chart_series_set_trendline_line</a>(series, &amp;line);</div>
</div><!-- fragment --><div class="image">
<img src="chart_trendline10.png" alt=""/>
</div>
<dl class="section note"><dt>Note</dt><dd>Trendlines cannot be added to series in a stacked chart, pie chart, doughnut chart or radar chart.</dd></dl>
<h1><a class="anchor" id="chart_error_bars"></a>
Working with Chart Error Bars</h1>
<p>Error bars can be added to a chart series to indicate error bounds in the data.</p>
<p>The error bars can be vertical <code>y_error_bars</code> (the most common type) or horizontal <code>x_error_bars</code> (for Bar and Scatter charts only). For convenience these can be accessed from a series as follows:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series-&gt;y_error_bars, ...);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series-&gt;x_error_bars, ...);</div>
</div><!-- fragment --><p>The error bar properties that can be set in Excel are show in the following dialog:</p>
<div class="image">
<img src="chart_error_bars0.png" alt=""/>
</div>
<p>Some of these properties can be set using the functions discussed below.</p>
<p>The <code><a class="el" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars()</a></code> function sets the error bar type and value associated with the type:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__series.html">lxw_chart_series</a> *series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart,</div>
<div class="line">                                            <span class="stringliteral">&quot;=Sheet1!$A$1:$A$5&quot;</span>,</div>
<div class="line">                                            <span class="stringliteral">&quot;=Sheet1!$B$1:$B$5&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f">LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</a>, 0);</div>
</div><!-- fragment --><div class="image">
<img src="chart_error_bars1.png" alt=""/>
</div>
<p>The error bar types that be used are:</p>
<ul>
<li><a class="el" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f">LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</a>: Standard error.</li>
<li><a class="el" href="chart_8h.html#a858b96fd44354565fd9019cdb26149feaba45d9e553700f3f1a3df0c1f80259c0">LXW_CHART_ERROR_BAR_TYPE_FIXED</a>: Fixed value.</li>
<li><a class="el" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea49e056be9e39bfca5268ae9eaab11c46">LXW_CHART_ERROR_BAR_TYPE_PERCENTAGE</a>: Percentage.</li>
<li><a class="el" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fead7300dcc1274164a42e2359a3dfc1465">LXW_CHART_ERROR_BAR_TYPE_STD_DEV</a>: Standard deviation(s).</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>Custom error bars are not currently supported.</dd></dl>
<p>All error bar types, apart from Standard error, should have a valid value to set the error range:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series1-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149feaba45d9e553700f3f1a3df0c1f80259c0">LXW_CHART_ERROR_BAR_TYPE_FIXED</a>, 2);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series2-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea49e056be9e39bfca5268ae9eaab11c46">LXW_CHART_ERROR_BAR_TYPE_PERCENTAGE</a>, 5);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series3-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fead7300dcc1274164a42e2359a3dfc1465">LXW_CHART_ERROR_BAR_TYPE_STD_DEV</a>, 1);</div>
</div><!-- fragment --><p>For the Standard error type the value is ignored.</p>
<p>The <code><a class="el" href="chart_8h.html#aa897ee54d4a19f264a6b8f9dd43604b3" title="Set the direction (up, down or both) of the error bars for a chart series.">chart_series_set_error_bars_direction()</a></code> function sets the direction of the error bars:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f">LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</a>, 0);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#aa897ee54d4a19f264a6b8f9dd43604b3">chart_series_set_error_bars_direction</a>(series-&gt;y_error_bars,</div>
<div class="line">                                      <a class="code" href="chart_8h.html#a5416ddeb493de3e78245d77d0af8a66ea359a4cea90dabfa009eeb80d2bde5a14">LXW_CHART_ERROR_BAR_DIR_PLUS</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_error_bars2.png" alt=""/>
</div>
<p>The valid directions are:</p>
<ul>
<li><a class="el" href="chart_8h.html#a5416ddeb493de3e78245d77d0af8a66ea5b459ae0fc66ee0629a273985ffc08d2">LXW_CHART_ERROR_BAR_DIR_BOTH</a>: Error bar extends in both directions. The default.</li>
<li><a class="el" href="chart_8h.html#a5416ddeb493de3e78245d77d0af8a66ea359a4cea90dabfa009eeb80d2bde5a14">LXW_CHART_ERROR_BAR_DIR_PLUS</a>: Error bar extends in positive direction.</li>
<li><a class="el" href="chart_8h.html#a5416ddeb493de3e78245d77d0af8a66eaec134bf6168f87ac999b0a5203d19013">LXW_CHART_ERROR_BAR_DIR_MINUS</a>: Error bar extends in negative direction.</li>
</ul>
<p>The <code><a class="el" href="chart_8h.html#ab03b0a4da953fa6bb47e2296b82476d2" title="Set the end cap type for the error bars of a chart series.">chart_series_set_error_bars_endcap()</a></code> function sets the end cap type for the error bars:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f">LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</a>, 0);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#ab03b0a4da953fa6bb47e2296b82476d2">chart_series_set_error_bars_endcap</a>(series-&gt;y_error_bars,</div>
<div class="line">                                   <a class="code" href="chart_8h.html#a2893fbacd275cd67fc0e310ea0101a7fa5d70a912eb58cf4790bbadf8bde2dcdd">LXW_CHART_ERROR_BAR_NO_CAP</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_error_bars3.png" alt=""/>
</div>
<p>The valid values are:</p>
<ul>
<li><a class="el" href="chart_8h.html#a2893fbacd275cd67fc0e310ea0101a7fad62f98e12866c933ee7c52da3af6fa8e">LXW_CHART_ERROR_BAR_END_CAP</a>: Flat end cap. The default.</li>
<li><a class="el" href="chart_8h.html#a2893fbacd275cd67fc0e310ea0101a7fa5d70a912eb58cf4790bbadf8bde2dcdd">LXW_CHART_ERROR_BAR_NO_CAP</a>: No end cap.</li>
</ul>
<p>The <code><a class="el" href="chart_8h.html#a97496720a6c6c9d0c82cf4f26bf71ae0" title="Set the line properties for a chart series error bars.">chart_series_set_error_bars_line()</a></code> function sets the line properties for the error bars:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a>     = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>,</div>
<div class="line">                       .dash_type = <a class="code" href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570a0b8b0397fefbaef241d5e99153a7a9ff">LXW_CHART_LINE_DASH_ROUND_DOT</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a>(series-&gt;y_error_bars,</div>
<div class="line">                            <a class="code" href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f">LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</a>, 0);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a97496720a6c6c9d0c82cf4f26bf71ae0">chart_series_set_error_bars_line</a>(series-&gt;y_error_bars, &amp;line);</div>
</div><!-- fragment --><div class="image">
<img src="chart_error_bars4.png" alt=""/>
</div>
<h1><a class="anchor" id="chart_points"></a>
Working with Chart Points</h1>
<p>In general formatting is applied to an entire series in a chart. However, it is occasionally required to format individual points within a series.</p>
<p>In Excel charts "points" have a different meaning depending on the type of chart:</p>
<ul>
<li>Line/Scatter chart: points are used to reference individual markers.</li>
<li>Bar/Column/Area charts: points are used to reference individual bars or areas.</li>
<li>Pie/Doughnut charts: points are used to reference each segment.</li>
</ul>
<p>The most common use case is to format segments of a pie chart like this example:</p>
 <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;xlsxwriter.h&quot;</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * Create a worksheet with an example Pie chart.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"><span class="keywordtype">int</span> main() {</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="structlxw__workbook.html">lxw_workbook</a>     *workbook  = <a class="code" href="workbook_8h.html#a1cf96608a23ee4eb0e8467c15240d00b">workbook_new</a>(<span class="stringliteral">&quot;chart_pie_colors.xlsx&quot;</span>);</div>
<div class="line">    <a class="code" href="structlxw__worksheet.html">lxw_worksheet</a>    *worksheet = <a class="code" href="workbook_8h.html#a81d456b4f65a464e78e4a0030ecc3c2e">workbook_add_worksheet</a>(workbook, NULL);</div>
<div class="line">    <a class="code" href="structlxw__chart__series.html">lxw_chart_series</a> *series;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Write some data for the chart. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;A1&quot;</span>), <span class="stringliteral">&quot;Pass&quot;</span>, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;A2&quot;</span>), <span class="stringliteral">&quot;Fail&quot;</span>, NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;B1&quot;</span>), 90,     NULL);</div>
<div class="line">    <a class="code" href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;B2&quot;</span>), 10,     NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create a pie chart. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart.html">lxw_chart</a> *chart = <a class="code" href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a>(workbook, <a class="code" href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85ca679756788a8bec4bfc1e1c723ec5246a">LXW_CHART_PIE</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the data series to the chart. */</span></div>
<div class="line">    series = <a class="code" href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a>(chart, <span class="stringliteral">&quot;=Sheet1!$A$1:$A$2&quot;</span>,</div>
<div class="line">                                     <span class="stringliteral">&quot;=Sheet1!$B$1:$B$2&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create some fills for the chart points/segments. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> red_fill     = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>  };</div>
<div class="line">    <a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> green_fill   = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a>};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the fills to the point objects. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> red_point   = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;red_fill  };</div>
<div class="line">    <a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> green_point = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;green_fill};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Create an array of pointer to chart points. Note, the array should be</span></div>
<div class="line"><span class="comment">     * NULL terminated. */</span></div>
<div class="line">    <a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> *points[] = {&amp;green_point,</div>
<div class="line">                                 &amp;red_point,</div>
<div class="line">                                 NULL};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Add the points to the series. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#a0e27dc551820c1d8d0e06cdd393f4b78">chart_series_set_points</a>(series, points);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Insert the chart into the worksheet. */</span></div>
<div class="line">    <a class="code" href="worksheet_8h.html#ac2067faaacb8bfa6550b019e915900a2">worksheet_insert_chart</a>(worksheet, <a class="code" href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a>(<span class="stringliteral">&quot;D2&quot;</span>), chart);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> <a class="code" href="workbook_8h.html#ad9e7aeebc0fd43562db5bcd527b2ee5e">workbook_close</a>(workbook);</div>
<div class="line">}</div>
</div><!-- fragment --><div class="image">
<img src="chart_points1.png" alt=""/>
</div>
<p>The <a class="el" href="structlxw__chart__point.html" title="Struct to represent an Excel chart data point.">lxw_chart_point</a> objects can be used to set the following properties for a chart point:</p>
<ul>
<li>Line/Border</li>
<li>Fill</li>
<li>Pattern</li>
</ul>
<p>These properties are explained in the Chart Formatting subsections below.</p>
<p>The points should be passed as a NULL terminated array of pointers to <a class="el" href="structlxw__chart__point.html" title="Struct to represent an Excel chart data point.">lxw_chart_point</a> objects:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> red_point   = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;red_fill  };</div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> green_point = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;green_fill};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> *points[] = {&amp;green_point,</div>
<div class="line">                             &amp;red_point,</div>
<div class="line">                             NULL}; <span class="comment">// Indicates the end of the list.</span></div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a0e27dc551820c1d8d0e06cdd393f4b78">chart_series_set_points</a>(series, points);</div>
</div><!-- fragment --><p>You can skip points in the series that you don't want to format by passing a zero-initialized <a class="el" href="structlxw__chart__point.html" title="Struct to represent an Excel chart data point.">lxw_chart_point</a>:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> default_point = {0, 0, 0};</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line         = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> red_fill     = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> green_fill   = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> red_point   = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;red_fill,   .line = &amp;line};</div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> green_point = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;green_fill, .line = &amp;line};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> *points[] = {&amp;red_point,</div>
<div class="line">                             &amp;default_point,</div>
<div class="line">                             &amp;green_point,</div>
<div class="line">                             &amp;default_point,</div>
<div class="line">                             &amp;red_point,</div>
<div class="line">                             NULL};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a0e27dc551820c1d8d0e06cdd393f4b78">chart_series_set_points</a>(series, points);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcac09f924f33e8068a175686cd968332a1">LXW_CHART_MARKER_SQUARE</a>);</div>
<div class="line"><a class="code" href="chart_8h.html#a9f90731ea7f0ff224a19315604ce2acb">chart_series_set_marker_size</a>(series, 10);</div>
</div><!-- fragment --><div class="image">
<img src="chart_points2.png" alt=""/>
</div>
<p>The array of <a class="el" href="structlxw__chart__point.html" title="Struct to represent an Excel chart data point.">lxw_chart_point</a> objects pointers corresponds to the order of the points in the series starting from the first point. However, it does not have to extend to the entire range of the series. It can be NULL terminated at any point in the series, such as in the previous example.</p>
<p>For Bar/Column/Area charts "points" refer to bars/areas within the chart:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a>  red_fill      = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> red_point     = {.<a class="code" href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">fill</a> = &amp;red_fill};</div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> default_point = {0, 0, 0};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="structlxw__chart__point.html">lxw_chart_point</a> *points[] = {&amp;default_point, &amp;default_point, &amp;red_point, NULL};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a0e27dc551820c1d8d0e06cdd393f4b78">chart_series_set_points</a>(series2, points);</div>
</div><!-- fragment --><div class="image">
<img src="chart_points3.png" alt=""/>
</div>
<h1><a class="anchor" id="chart_labels"></a>
Working with Chart Data Labels</h1>
<p>Data labels can be added to a chart series to indicate the values of the plotted data points. The functions described below turn on and set data label properties.</p>
<p>The <code><a class="el" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9" title="Add data labels to a chart series.">chart_series_set_labels()</a></code> function is used to turn on data labels for a chart series:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels1.png" alt=""/>
</div>
<p>By default data labels are displayed in Excel with only the values shown:</p>
<div class="image">
<img src="chart_data_labels2.png" alt=""/>
</div>
<p>However, it is possible to configure other display options, as shown in the functions below.</p>
<p>The <code><a class="el" href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726" title="Set the display options for the labels of a data series.">chart_series_set_labels_options()</a></code> function is used to set the parameters that are displayed in the series data label:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726">chart_series_set_labels_options</a>(series, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels3.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#a35e370165e50f5e053ccdc96ed933e66" title="Set the separator for the data label captions.">chart_series_set_labels_separator()</a></code> function is used to change the separator between multiple data label items. The default options is a comma separator as shown in the previous example.</p>
<p>The available options are:</p>
<ul>
<li><a class="el" href="chart_8h.html#a2775e02cfba1d2b2dc85ebadc03f264da11001b8cf225130f78e2f362e2bc23e6">LXW_CHART_LABEL_SEPARATOR_SEMICOLON</a>: semicolon separator.</li>
<li><a class="el" href="chart_8h.html#a2775e02cfba1d2b2dc85ebadc03f264dabdbafc759aec4f257240db03b95d3b17">LXW_CHART_LABEL_SEPARATOR_PERIOD</a>: a period (dot) separator.</li>
<li><a class="el" href="chart_8h.html#a2775e02cfba1d2b2dc85ebadc03f264da3299a79c3621de0373dac60fdc37f2fa">LXW_CHART_LABEL_SEPARATOR_NEWLINE</a>: a newline separator.</li>
<li><a class="el" href="chart_8h.html#a2775e02cfba1d2b2dc85ebadc03f264dad0b42ecc2120906feb6b055f69e9f909">LXW_CHART_LABEL_SEPARATOR_SPACE</a>: a space separator.</li>
</ul>
<p>For example:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726">chart_series_set_labels_options</a>(series, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>);</div>
<div class="line"><a class="code" href="chart_8h.html#a35e370165e50f5e053ccdc96ed933e66">chart_series_set_labels_separator</a>(series, <a class="code" href="chart_8h.html#a2775e02cfba1d2b2dc85ebadc03f264da3299a79c3621de0373dac60fdc37f2fa">LXW_CHART_LABEL_SEPARATOR_NEWLINE</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels4.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#a6f4baebf02df517d55a5d1447e3511cd" title="Set the data label position for a series.">chart_series_set_labels_position()</a></code> function sets the position of the labels in the data series:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#a6f4baebf02df517d55a5d1447e3511cd">chart_series_set_labels_position</a>(series, <a class="code" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430af5e0e1d7fda566367f65c52f793a25c8">LXW_CHART_LABEL_POSITION_ABOVE</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels5.png" alt=""/>
</div>
<p>In Excel the allowable data label positions vary for different chart types. The allowable, and default, positions are:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadLeft">Position  </th><th class="markdownTableHeadLeft">Line, Scatter  </th><th class="markdownTableHeadLeft">Bar, Column  </th><th class="markdownTableHeadLeft">Pie, Doughnut  </th><th class="markdownTableHeadLeft">Area, Radar   </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430a5fb7ff3cb67df85145d5e5c0240f2402">LXW_CHART_LABEL_POSITION_CENTER</a>  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft">Yes (default)   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430a3aaedbb66c7b914d4f73df482c08ee03">LXW_CHART_LABEL_POSITION_RIGHT</a>  </td><td class="markdownTableBodyLeft">Yes (default)  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430a5f272310338b0306fc427450ca612b11">LXW_CHART_LABEL_POSITION_LEFT</a>  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430af5e0e1d7fda566367f65c52f793a25c8">LXW_CHART_LABEL_POSITION_ABOVE</a>  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430aa6f5b88076ae9dea4b185192153a276b">LXW_CHART_LABEL_POSITION_BELOW</a>  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430a5e03c40128bf3b64ce97cd093d620a4b">LXW_CHART_LABEL_POSITION_INSIDE_BASE</a>  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430a7b9130ecc756626e9b2f19073713a4da">LXW_CHART_LABEL_POSITION_INSIDE_END</a>  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430a2cab22e8438bfcef9be58e54b12d5858">LXW_CHART_LABEL_POSITION_OUTSIDE_END</a>  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft">Yes (default)  </td><td class="markdownTableBodyLeft">Yes  </td><td class="markdownTableBodyLeft"></td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><a class="el" href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430aee28cc8ec267684d491a0a69caf2a2f8">LXW_CHART_LABEL_POSITION_BEST_FIT</a>  </td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft"></td><td class="markdownTableBodyLeft">Yes (default)  </td><td class="markdownTableBodyLeft"></td></tr>
</table>
<p>The <code><a class="el" href="chart_8h.html#ab81a050644bc887512b435b1022950aa" title="Set leader lines for Pie and Doughnut charts.">chart_series_set_labels_leader_line()</a></code> function is used to turn on leader lines for the data label of a series. It is mainly used for pie or doughnut charts:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#ab81a050644bc887512b435b1022950aa">chart_series_set_labels_leader_line</a>(series);</div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>Even when leader lines are turned on they aren't automatically visible in Excel or XlsxWriter. Due to an Excel limitation (or design) leader lines only appear if the data label is moved manually or if the data labels are very close and need to be adjusted automatically.</dd></dl>
<p>The <code><a class="el" href="chart_8h.html#a0da8f7fad7a0967686a6006a7178c41b" title="Set the legend key for a data label in a chart series.">chart_series_set_labels_legend()</a></code> function is used to set the legend key for a data series:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#a0da8f7fad7a0967686a6006a7178c41b">chart_series_set_labels_legend</a>(series);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels6.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#ac13170c981b800c64596e4355e87044c" title="Set the percentage for a Pie/Doughnut data point.">chart_series_set_labels_percentage()</a></code> function is used to turn on the display of data labels as a percentage for a series. It is mainly used for pie charts:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726">chart_series_set_labels_options</a>(series, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>, <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>);</div>
<div class="line"><a class="code" href="chart_8h.html#ac13170c981b800c64596e4355e87044c">chart_series_set_labels_percentage</a>(series);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels7.png" alt=""/>
</div>
<p>The <code><a class="el" href="chart_8h.html#aaaf55fefef465fee308c5fe5be44674b" title="Set the number format for chart data labels in a series.">chart_series_set_labels_num_format()</a></code> function is used to set the number format for data labels:</p>
<div class="fragment"><div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#aaaf55fefef465fee308c5fe5be44674b">chart_series_set_labels_num_format</a>(series, <span class="stringliteral">&quot;$0.00&quot;</span>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels8.png" alt=""/>
</div>
<p>The number format is similar to the Worksheet Cell Format num_format, see <code><a class="el" href="format_8h.html#af77bbd0003344cb16d455c7fb709e16c" title="Set the number format for a cell.">format_set_num_format()</a></code>.</p>
<p>The <code><a class="el" href="chart_8h.html#aea2957adf1e8c754f771bbcb836229d4" title="Set the font properties for chart data labels in a series.">chart_series_set_labels_font()</a></code> function is used to set the font for data labels:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Consolas&quot;</span>, .color = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"><a class="code" href="chart_8h.html#aea2957adf1e8c754f771bbcb836229d4">chart_series_set_labels_font</a>(series, &amp;font);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels9.png" alt=""/>
</div>
<p>For more information see <a class="el" href="working_with_charts.html#chart_fonts">Chart formatting: Fonts</a> below.</p>
<p>The <code><a class="el" href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6" title="Set the line properties for the data labels in a chart series.">chart_series_set_labels_line()</a></code>, <code><a class="el" href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217" title="Set the fill properties for the data labels in a chart series.">chart_series_set_labels_fill()</a></code> and <code><a class="el" href="chart_8h.html#afa638b6c6dd10d58d43ee8d1f6667833" title="Set the pattern properties for the data labels in a chart series.">chart_series_set_labels_pattern()</a></code> functions can be used to set the formatting for a data series using standard chart formatting structs:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6">chart_series_set_labels_line</a>(series, &amp;line);</div>
<div class="line"><a class="code" href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217">chart_series_set_labels_fill</a>(series, &amp;fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels24.png" alt=""/>
</div>
<h2><a class="anchor" id="chart_custom_labels"></a>
Custom Chart Data Labels</h2>
<p>The <code><a class="el" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35" title="Set the properties for data labels in a series.">chart_series_set_labels_custom()</a></code> function is used to set the properties of individual data labels in a series. The most common use for this is to set custom text or number labels:</p>
<div class="fragment"><div class="line"><span class="comment">// Add the series data labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create some custom labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Jan&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Feb&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Mar&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Apr&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;May&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Jun&quot;</span>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an array of label pointers. NULL indicates the end of the array.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels[] = {</div>
<div class="line">    &amp;data_label1,</div>
<div class="line">    &amp;data_label2,</div>
<div class="line">    &amp;data_label3,</div>
<div class="line">    &amp;data_label4,</div>
<div class="line">    &amp;data_label5,</div>
<div class="line">    &amp;data_label6,</div>
<div class="line">    NULL</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set the custom labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels18.png" alt=""/>
</div>
<p>As shown in the previous example the <code><a class="el" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35" title="Set the properties for data labels in a series.">chart_series_set_labels_custom()</a></code> function takes a pointer to an array of <a class="el" href="structlxw__chart__data__label.html" title="Struct to represent an Excel chart data label.">lxw_chart_data_label</a> pointers. The list should be <code>NULL</code> terminated. Any <a class="el" href="structlxw__chart__data__label.html" title="Struct to represent an Excel chart data label.">lxw_chart_data_label</a> items set to a default initialization or omitted from the list will be assigned the default data label value:</p>
<div class="fragment"><div class="line"><span class="comment">// Add the series data labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create some custom labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> default_label = {0};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label2   = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Feb&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label3   = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Mar&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label4   = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Apr&quot;</span>};</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an array of label pointers. NULL indicates the end of the array.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels[] = {</div>
<div class="line">    &amp;default_label,</div>
<div class="line">    &amp;data_label2,</div>
<div class="line">    &amp;data_label3,</div>
<div class="line">    &amp;data_label4,</div>
<div class="line">    NULL</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set the custom labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels19.png" alt=""/>
</div>
<p>The <code>value</code> element in the <a class="el" href="structlxw__chart__data__label.html" title="Struct to represent an Excel chart data label.">lxw_chart_data_label</a> struct should be a string, a number as a string, or formula string that refers to a cell from which the value will be taken:</p>
<div class="fragment"><div class="line"><span class="comment">// Add the series data labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create some custom labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$1&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$2&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$3&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$4&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$5&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$6&quot;</span>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an array of label pointers. NULL indicates the end of the array.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels[] = {</div>
<div class="line">    &amp;data_label1,</div>
<div class="line">    &amp;data_label2,</div>
<div class="line">    &amp;data_label3,</div>
<div class="line">    &amp;data_label4,</div>
<div class="line">    &amp;data_label5,</div>
<div class="line">    &amp;data_label6,</div>
<div class="line">    NULL</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set the custom labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels);</div>
</div><!-- fragment --><p>The <code>font</code> element in the <a class="el" href="structlxw__chart__data__label.html" title="Struct to represent an Excel chart data label.">lxw_chart_data_label</a> struct can be used to set the font for the label in the data series (see <a class="el" href="working_with_charts.html#chart_fonts">Chart formatting: Fonts</a>):</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a7921a876ed780271df6e0f4bca8e38f5">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Add the series data labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create some custom labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$1&quot;</span>, .font = &amp;font};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$2&quot;</span>, .font = &amp;font};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$3&quot;</span>, .font = &amp;font};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$4&quot;</span>, .font = &amp;font};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$5&quot;</span>, .font = &amp;font};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;=Sheet1!$C$6&quot;</span>, .font = &amp;font};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an array of label pointers. NULL indicates the end of the array.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels[] = {</div>
<div class="line">    &amp;data_label1,</div>
<div class="line">    &amp;data_label2,</div>
<div class="line">    &amp;data_label3,</div>
<div class="line">    &amp;data_label4,</div>
<div class="line">    &amp;data_label5,</div>
<div class="line">    &amp;data_label6,</div>
<div class="line">    NULL</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set the custom labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels20.png" alt=""/>
</div>
<p>The <code>hide</code> element in the <a class="el" href="structlxw__chart__data__label.html" title="Struct to represent an Excel chart data label.">lxw_chart_data_label</a> struct can be used to hide/delete labels in a series. This can be useful if you want to highlight one or more cells in the series, for example the maximum and the minimum:</p>
<div class="fragment"><div class="line"><span class="comment">// Add the series data labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a>(series);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create some custom labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> hide = {.<a class="code" href="structlxw__chart__data__label.html#a4cd68183846a54e6fa95edc8ba873ec9">hide</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> keep = {.<a class="code" href="structlxw__chart__data__label.html#a4cd68183846a54e6fa95edc8ba873ec9">hide</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an array of label pointers. NULL indicates the end of the array.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels[] = {</div>
<div class="line">    &amp;hide,</div>
<div class="line">    &amp;keep,</div>
<div class="line">    &amp;hide,</div>
<div class="line">    &amp;hide,</div>
<div class="line">    &amp;keep,</div>
<div class="line">    &amp;hide,</div>
<div class="line">    NULL</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set the custom labels.</span></div>
<div class="line"><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels21.png" alt=""/>
</div>
<p>Standard chart formatting such as <a class="el" href="structlxw__chart__line.html" title="Struct to represent a chart line.">lxw_chart_line</a>, <a class="el" href="structlxw__chart__fill.html" title="Struct to represent a chart fill.">lxw_chart_fill</a> and <a class="el" href="structlxw__chart__pattern.html" title="Struct to represent a chart pattern.">lxw_chart_pattern</a> can also be applied to custom data labels via <a class="el" href="structlxw__chart__data__label.html" title="Struct to represent an Excel chart data label.">lxw_chart_data_label</a>:</p>
<div class="fragment"><div class="line"><span class="comment">// Set the border/line and fill for the data labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line2 = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill2 = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line3 = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill3 = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a>};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create some custom labels.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_1 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Amy&quot;</span>, .line = &amp;line3};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_2 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Bea&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_3 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Eva&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_4 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Fay&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_5 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Liv&quot;</span>};</div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> data_label9_6 = {.<a class="code" href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">value</a> = <span class="stringliteral">&quot;Una&quot;</span>, .fill = &amp;fill3};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Set the default formatting for the data labels in the series.</span></div>
<div class="line"><a class="code" href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6">chart_series_set_labels_line</a>(series, &amp;line2);</div>
<div class="line"><a class="code" href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217">chart_series_set_labels_fill</a>(series, &amp;fill2);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an array of label pointers. NULL indicates the end of the array.</span></div>
<div class="line"><a class="code" href="structlxw__chart__data__label.html">lxw_chart_data_label</a> *data_labels9[] = {</div>
<div class="line">    &amp;data_label9_1,</div>
<div class="line">    &amp;data_label9_2,</div>
<div class="line">    &amp;data_label9_3,</div>
<div class="line">    &amp;data_label9_4,</div>
<div class="line">    &amp;data_label9_5,</div>
<div class="line">    &amp;data_label9_6,</div>
<div class="line">    NULL</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">/* Set the custom labels. */</span></div>
<div class="line"><a class="code" href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a>(series, data_labels9);</div>
</div><!-- fragment --><div class="image">
<img src="chart_data_labels25.png" alt=""/>
</div>
<h1><a class="anchor" id="chart_formatting"></a>
Chart Formatting</h1>
<p>The following chart formatting properties can be set for any chart object that they apply to (and that are supported by libxlsxwriter) such as chart lines, column fill areas and other chart elements:</p>
<ul>
<li>Font</li>
<li>Line/Border</li>
<li>Fill</li>
<li>Pattern</li>
</ul>
<p>For example:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> chart_line  = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> marker_line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> marker_fill = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcac09f924f33e8068a175686cd968332a1">LXW_CHART_MARKER_SQUARE</a>);</div>
<div class="line"><a class="code" href="chart_8h.html#a9f90731ea7f0ff224a19315604ce2acb">chart_series_set_marker_size</a>(series, 5);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;chart_line);</div>
<div class="line"><a class="code" href="chart_8h.html#a416463dd44486e6b6a23209789a3642e">chart_series_set_marker_line</a>(series, &amp;marker_line);</div>
<div class="line"><a class="code" href="chart_8h.html#a73af3ba49f013b2a12ecfe15b7ba50c7">chart_series_set_marker_fill</a>(series, &amp;marker_fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_formatting2.png" alt=""/>
</div>
<p>These properties are explained in the subsections below.</p>
<h2><a class="anchor" id="chart_fonts"></a>
Chart formatting: Fonts</h2>
<p>Font properties can be set for several chart objects such as chart titles, axis labels, and axis numbering.</p>
<p>A chart font <a class="el" href="structlxw__chart__font.html" title="Struct to represent a chart font.">lxw_chart_font</a> struct with default properties is:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a>      = <span class="stringliteral">&quot;Calibri&quot;</span>,</div>
<div class="line">                       .size      = 10,</div>
<div class="line">                       .bold      = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>,</div>
<div class="line">                       .italic    = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>,</div>
<div class="line">                       .underline = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>,</div>
<div class="line">                       .rotation  = 0,</div>
<div class="line">                       .color     = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>};</div>
</div><!-- fragment --><p>The font properties are:</p>
<ul>
<li><code>name</code>: Set the font name:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Arial&quot;</span>};</div>
</div><!-- fragment --><ul>
<li><code>size</code>: Set the font size:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Arial&quot;</span>, .size = 11};</div>
</div><!-- fragment --><ul>
<li><code>bold</code>: Set the font bold property:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#abca1be9b66dcd9bc4558cc97556456b5">bold</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
</div><!-- fragment --><ul>
<li><code>italic</code>: Set the font italic property:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#ab202b61d5a753874fdd963646e2a0e38">italic</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
</div><!-- fragment --><ul>
<li><code>underline</code>: Set the font underline property:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a13fce73724d63f5f2ab70a1abf64f758">underline</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
</div><!-- fragment --><ul>
<li><code>rotation</code>: Set the font rotation, angle, property in the range -90 to 90 deg:</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a6ed9b251728efcaf0e8ee460377ab17f">rotation</a> = 45};</div>
</div><!-- fragment --><p>This is useful for displaying axis data such as dates in a more compact format.</p>
<ul>
<li><code>color</code>: Set the font color property. It can be a HTML style RGB color or a limited number of named colors (see <a class="el" href="working_with_colors.html">Working with Colors</a> for more information):</li>
</ul>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font = {.<a class="code" href="structlxw__chart__font.html#a7921a876ed780271df6e0f4bca8e38f5">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a>};</div>
</div><!-- fragment --><p>Here is a longer example with several chart formats:</p>
 <div class="fragment"><div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font1 = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Calibri&quot;</span>, .color = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a>};</div>
<div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font2 = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Courier&quot;</span>, .color = 0x92D050};</div>
<div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font3 = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Arial&quot;</span>,   .color = 0x00B0F0};</div>
<div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font4 = {.<a class="code" href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">name</a> = <span class="stringliteral">&quot;Century&quot;</span>, .color = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font5 = {.<a class="code" href="structlxw__chart__font.html#a6ed9b251728efcaf0e8ee460377ab17f">rotation</a> = -30};</div>
<div class="line">    <a class="code" href="structlxw__chart__font.html">lxw_chart_font</a> font6 = {.<a class="code" href="structlxw__chart__font.html#abca1be9b66dcd9bc4558cc97556456b5">bold</a>      = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>,</div>
<div class="line">                            .italic    = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>,</div>
<div class="line">                            .underline = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>,</div>
<div class="line">                            .color     = 0x7030A0};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Write the chart title with a font. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a>(chart, <span class="stringliteral">&quot;Test Results&quot;</span>);</div>
<div class="line">    <a class="code" href="chart_8h.html#ab3cde364ea66bb2edfae426299fe7dc7">chart_title_set_name_font</a>(chart, &amp;font1);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Write the Y axis with a font. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#a650d569ff37a087101b7bff4ee7bb130">chart_axis_set_name</a>(chart-&gt;<a class="code" href="structlxw__chart.html#aec951bda729ea8184fa0827c5f091f37">y_axis</a>, <span class="stringliteral">&quot;Units&quot;</span>);</div>
<div class="line">    <a class="code" href="chart_8h.html#ac4be8325cbcaeddda0a92f1809d8156d">chart_axis_set_name_font</a>(chart-&gt;<a class="code" href="structlxw__chart.html#aec951bda729ea8184fa0827c5f091f37">y_axis</a>, &amp;font2);</div>
<div class="line">    <a class="code" href="chart_8h.html#a01f1ac1674089e0dc219dc3214b911c4">chart_axis_set_num_font</a>(chart-&gt;<a class="code" href="structlxw__chart.html#aec951bda729ea8184fa0827c5f091f37">y_axis</a>, &amp;font3);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Write the X axis with a font. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#a650d569ff37a087101b7bff4ee7bb130">chart_axis_set_name</a>(chart-&gt;<a class="code" href="structlxw__chart.html#a17fa7931e6825a60de50444438e7f718">x_axis</a>, <span class="stringliteral">&quot;Month&quot;</span>);</div>
<div class="line">    <a class="code" href="chart_8h.html#ac4be8325cbcaeddda0a92f1809d8156d">chart_axis_set_name_font</a>(chart-&gt;<a class="code" href="structlxw__chart.html#a17fa7931e6825a60de50444438e7f718">x_axis</a>, &amp;font4);</div>
<div class="line">    <a class="code" href="chart_8h.html#a01f1ac1674089e0dc219dc3214b911c4">chart_axis_set_num_font</a>(chart-&gt;<a class="code" href="structlxw__chart.html#a17fa7931e6825a60de50444438e7f718">x_axis</a>, &amp;font5);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* Display the chart legend at the bottom of the chart. */</span></div>
<div class="line">    <a class="code" href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a>(chart, <a class="code" href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22ad8ecb14a4843e242f037b00c8d28c8ec">LXW_CHART_LEGEND_BOTTOM</a>);</div>
<div class="line">    <a class="code" href="chart_8h.html#ac24ae880bab2fa949d8b84a25fc9a457">chart_legend_set_font</a>(chart, &amp;font6);</div>
</div><!-- fragment --><div class="image">
<img src="chart_fonts.png" alt=""/>
</div>
<h2><a class="anchor" id="chart_lines"></a>
Chart formatting: Line</h2>
<p>The line format is used to specify properties of line objects that appear in a chart such as a plotted line on a chart or a border.</p>
<p>A chart line <a class="el" href="structlxw__chart__line.html" title="Struct to represent a chart line.">lxw_chart_line</a> struct with default properties is:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a651a52de6b66e19d5a43ee0c219502b2">none</a>      = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>,</div>
<div class="line">                       .color     = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>,</div>
<div class="line">                       .width     = 2.25,</div>
<div class="line">                       .dash_type = <a class="code" href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570ac86d05550348d57f941c2a4c6e55d4e2">LXW_CHART_LINE_DASH_SOLID</a>};</div>
</div><!-- fragment --><p>The <code>none</code> member is uses to turn the line off (it is always on by default except in Scatter charts). This is useful if you wish to plot a series with markers without a line, or a column fill without a border:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a651a52de6b66e19d5a43ee0c219502b2">none</a> = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;line);</div>
<div class="line"><a class="code" href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a>(series, <a class="code" href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca3575e2c5d289739b8c5b825c13893ff7">LXW_CHART_MARKER_AUTOMATIC</a>);</div>
</div><!-- fragment --><div class="image">
<img src="chart_formatting3.png" alt=""/>
</div>
<p>The <code>color</code> member sets the color of the line. It can be a HTML style RGB color or a limited number of named colors (see <a class="el" href="working_with_colors.html">Working with Colors</a> for more information):</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = 0xFF9900};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;line);</div>
</div><!-- fragment --><div class="image">
<img src="chart_formatting4.png" alt=""/>
</div>
<p>The <code>width</code> member sets the width of the line. It should be specified in increments of 0.25 of a point as in Excel:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#ab548d8a04d084df9f14cea072111b052">width</a> = 4.25};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;line);</div>
</div><!-- fragment --><div class="image">
<img src="chart_formatting_width.png" alt=""/>
</div>
<p>The <code>dash_type</code> member sets the dash style of the line:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a0f3901f6d5faa3a8fa8057a56ded89de">dash_type</a> = <a class="code" href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570ae5fefc31566d4ac3f9268a37e7629911">LXW_CHART_LINE_DASH_DASH_DOT</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;line);</div>
</div><!-- fragment --><div class="image">
<img src="chart_formatting5.png" alt=""/>
</div>
<p>The following <a class="el" href="chart_8h.html#a1149825d03f8551ecac138ddd184c2e9" title="Chart line dash types.">lxw_chart_line_dash_type</a> values are available. They are shown in the order that they appear in the Excel dialog:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Define  </th><th class="markdownTableHeadNone">Excel name   </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_SOLID  </td><td class="markdownTableBodyNone">Solid   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_ROUND_DOT  </td><td class="markdownTableBodyNone">Round Dot   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_SQUARE_DOT  </td><td class="markdownTableBodyNone">Square Dot   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_DASH  </td><td class="markdownTableBodyNone">Dash   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_DASH_DOT  </td><td class="markdownTableBodyNone">Dash Dot   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_LONG_DASH  </td><td class="markdownTableBodyNone">Long Dash   </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_LONG_DASH_DOT  </td><td class="markdownTableBodyNone">Long Dash Dot   </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyNone">LXW_CHART_LINE_DASH_LONG_DASH_DOT_DOT  </td><td class="markdownTableBodyNone">Long Dash Dot Dot   </td></tr>
</table>
<p>The default line style is <code>#LXW_CHART_LINE_DASH_SOLID</code>.</p>
<p>More than one line property can be specified at a time:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a>     = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>,</div>
<div class="line">                       .width     = 1.25,</div>
<div class="line">                       .dash_type = <a class="code" href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570a2e9fdd36dd3ad7cc2381ce6be26dbc7e">LXW_CHART_LINE_DASH_SQUARE_DOT</a>};</div>
</div><!-- fragment --><div class="image">
<img src="chart_formatting_multiple.png" alt=""/>
</div>
<h2><a class="anchor" id="chart_borders"></a>
Chart formatting: Border</h2>
<p>In Excel chart formatting the <code>border</code> property is a synonym for <code>line</code> when the object being formatting also has a <code>fill</code> property.</p>
<p>Anywhere you see <code>border</code> in an Excel chart dialog you can use the equivalent libxlsxwriter <code>line</code> function.</p>
<h2><a class="anchor" id="chart_fills"></a>
Chart formatting: Fill</h2>
<p>The fill format is used to specify properties of chart objects that internal boundaries such as a column chart.</p>
<p>A chart fill <a class="el" href="structlxw__chart__fill.html" title="Struct to represent a chart fill.">lxw_chart_fill</a> struct with default properties is:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a97c6c00984b20f692af6b6c1ac2cc3b4">none</a>         = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a>,</div>
<div class="line">                       .color        = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>,</div>
<div class="line">                       .transparency = 0};</div>
</div><!-- fragment --><p>The none property is used to turn the fill property off (it is generally on by default):</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a97c6c00984b20f692af6b6c1ac2cc3b4">none</a>  = <a class="code" href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;line);</div>
<div class="line"><a class="code" href="chart_8h.html#a6f1d7cd452a4a3f87046468ce5588bfd">chart_series_set_fill</a>(series, &amp;fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_fill1.png" alt=""/>
</div>
<p>The <code>color</code> member sets the color of the fill area. It can be a HTML style RGB color or a limited number of named colors (see <a class="el" href="working_with_colors.html">Working with Colors</a> for more information):</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = 0xFF9900};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a6f1d7cd452a4a3f87046468ce5588bfd">chart_series_set_fill</a>(series, &amp;fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_fill2.png" alt=""/>
</div>
<p>The <code>transparency</code> member sets the transparency of the solid fill color in the integer range 1 - 100:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a>        = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a>,</div>
<div class="line">                       .transparency = 50};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a6f1d7cd452a4a3f87046468ce5588bfd">chart_series_set_fill</a>(series, &amp;fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_fill3.png" alt=""/>
</div>
<p>The <code>fill</code> format is generally used in conjunction with a border which can be set via the <code>line</code> format:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__line.html">lxw_chart_line</a> line = {.<a class="code" href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a>};</div>
<div class="line"><a class="code" href="structlxw__chart__fill.html">lxw_chart_fill</a> fill = {.<a class="code" href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">color</a> = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a>};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a>(series, &amp;line);</div>
<div class="line"><a class="code" href="chart_8h.html#a6f1d7cd452a4a3f87046468ce5588bfd">chart_series_set_fill</a>(series, &amp;fill);</div>
</div><!-- fragment --><div class="image">
<img src="chart_fill4.png" alt=""/>
</div>
<h2><a class="anchor" id="chart_patterns"></a>
Chart formatting: Pattern</h2>
<p>The pattern fill is used to specify pattern filled areas of chart objects such as the interior of a column or the background of the chart itself.</p>
<p>A chart pattern <a class="el" href="structlxw__chart__pattern.html" title="Struct to represent a chart pattern.">lxw_chart_pattern</a> struct with default properties is:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__pattern.html">lxw_chart_pattern</a> pattern = {.<a class="code" href="structlxw__chart__pattern.html#ad89b0a7ee149372b44b42519d9ae6d80">type</a>      = <a class="code" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da5a62210a0468e996272d93cbf1cb9209">LXW_CHART_PATTERN_NONE</a>,</div>
<div class="line">                             .fg_color  = LXW_COLOR_NONE,;</div>
<div class="line">                             .bg_color  = <a class="code" href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba77f6d9e520849cf6c25a7f33cf303da2">LXW_COLOR_WHITE</a>};</div>
</div><!-- fragment --><p>Where the members are:</p>
<ul>
<li><code>pattern</code>: The pattern to be applied (required).</li>
<li><code>fg_color</code>: The foreground color of the pattern (required).</li>
<li><code>bg_color</code>: The background color (optional, defaults to white).</li>
</ul>
<p>The foreground color, <code>fg_color</code>, is a required parameter and can be HTML style RGB color or a limited number of named colors (see <a class="el" href="working_with_colors.html">Working with Colors</a> for more information):</p>
<p>The background color, <code>bg_color</code>, is optional and defaults to LXW_COLOR_WHITE.</p>
<p>For example:</p>
<div class="fragment"><div class="line"><a class="code" href="structlxw__chart__pattern.html">lxw_chart_pattern</a> pattern1 = {.<a class="code" href="structlxw__chart__pattern.html#ad89b0a7ee149372b44b42519d9ae6d80">type</a> = <a class="code" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da533285cbc53748d985e923ff1ccc4650">LXW_CHART_PATTERN_SHINGLE</a>,</div>
<div class="line">                              .fg_color = 0x804000,</div>
<div class="line">                              .bg_color = 0XC68C53};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="structlxw__chart__pattern.html">lxw_chart_pattern</a> pattern2 = {.<a class="code" href="structlxw__chart__pattern.html#ad89b0a7ee149372b44b42519d9ae6d80">type</a> = <a class="code" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9daf528922e8775b461b61eb077644c2478">LXW_CHART_PATTERN_HORIZONTAL_BRICK</a>,</div>
<div class="line">                              .fg_color = 0XB30000,</div>
<div class="line">                              .bg_color = 0XFF6666};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="chart_8h.html#a36f77a797d545b07a656965e4bf2978b">chart_series_set_pattern</a>(series1, &amp;pattern1);</div>
<div class="line"><a class="code" href="chart_8h.html#a36f77a797d545b07a656965e4bf2978b">chart_series_set_pattern</a>(series2, &amp;pattern2);</div>
</div><!-- fragment --><div class="image">
<img src="chart_pattern.png" alt=""/>
</div>
<p>The following patterns <a class="el" href="chart_8h.html#aab15ef290c6204f63162890bd05db7d9" title="Chart pattern types.">lxw_chart_pattern_type</a> can be applied:</p>
<ul>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dac24f9a61bd0f1347d0a71413d7482086">LXW_CHART_PATTERN_PERCENT_5</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da3f864e01a4b50b5ed894c58c74ea5044">LXW_CHART_PATTERN_PERCENT_10</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da343b42b49d911c18661ae673c0714252">LXW_CHART_PATTERN_PERCENT_20</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da0f64d55a296609974db6ba350deb5be8">LXW_CHART_PATTERN_PERCENT_25</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da21eba92923b8d4aaa59c09263ad536f1">LXW_CHART_PATTERN_PERCENT_30</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da71df56fba88ea1d6d2887050e88ba189">LXW_CHART_PATTERN_PERCENT_40</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da12e7c7ad9f342c0f0be98fd4d20fcc74">LXW_CHART_PATTERN_PERCENT_50</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9daaaf89778f37e47326b8d4de5db49f185">LXW_CHART_PATTERN_PERCENT_60</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da3a8d32a58e356e7e5021fbff51cafe8f">LXW_CHART_PATTERN_PERCENT_70</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da00b805977a00752ba3980145da8d3f23">LXW_CHART_PATTERN_PERCENT_75</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da76073462d50186cbe7c8f78943419fd6">LXW_CHART_PATTERN_PERCENT_80</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da48f40a9e6662b6c734b1062e0850ad5e">LXW_CHART_PATTERN_PERCENT_90</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da6278b9d0eb4a4e120ad0efca5fe21ea8">LXW_CHART_PATTERN_LIGHT_DOWNWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da9295301a4fde1d07b912f064104ac580">LXW_CHART_PATTERN_LIGHT_UPWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9daa07a2ea802f5d1e31f50c1b90bccf66c">LXW_CHART_PATTERN_DARK_DOWNWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da2bab5bb1568aa4488b08b0bf07ac1b45">LXW_CHART_PATTERN_DARK_UPWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da66cae16b81e7d20416a4a570ef8d0c16">LXW_CHART_PATTERN_WIDE_DOWNWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da0b278b42ec1f8332f0b87cd65dda9310">LXW_CHART_PATTERN_WIDE_UPWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da9d186fc40d05a7bbd1c319d0baea0a0b">LXW_CHART_PATTERN_LIGHT_VERTICAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dacf0ba4ae24b26c4444210d15bee98190">LXW_CHART_PATTERN_LIGHT_HORIZONTAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da710d8a2e64454b86da691cfa9b78f185">LXW_CHART_PATTERN_NARROW_VERTICAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dad6bb75b692915b7a31932e7ad216002a">LXW_CHART_PATTERN_NARROW_HORIZONTAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da92554731f397b77e05349819d33e6a9e">LXW_CHART_PATTERN_DARK_VERTICAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da52616899771a9e22e975b66238685eaf">LXW_CHART_PATTERN_DARK_HORIZONTAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da2bed857ed24d9e9a9c1f2ac46f9f3442">LXW_CHART_PATTERN_DASHED_DOWNWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da1c8fedb44808807126126936bcf70e94">LXW_CHART_PATTERN_DASHED_UPWARD_DIAGONAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dad1c1816ae52e86e51878ec85a081ece2">LXW_CHART_PATTERN_DASHED_HORIZONTAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da6a42c81611ef25fc43702ddc6dc846ee">LXW_CHART_PATTERN_DASHED_VERTICAL</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dafa5c51d0c66faa4f7164598ff4205c53">LXW_CHART_PATTERN_SMALL_CONFETTI</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dae36317ed4f7ceea17731b4b9ac9b5619">LXW_CHART_PATTERN_LARGE_CONFETTI</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da5e9e62b299164b226e3530a17927ccde">LXW_CHART_PATTERN_ZIGZAG</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da8e355806e2f97b12bce7ca2c29e1fcf0">LXW_CHART_PATTERN_WAVE</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dae9ee90da2c3750f667f915b608d0b000">LXW_CHART_PATTERN_DIAGONAL_BRICK</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9daf528922e8775b461b61eb077644c2478">LXW_CHART_PATTERN_HORIZONTAL_BRICK</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dac59d890caaa9fd94368a5f9c22b46065">LXW_CHART_PATTERN_WEAVE</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da2f131a3e22118542890b8814ecee7746">LXW_CHART_PATTERN_PLAID</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da9144157cacfbce24aa06c319f3d7f3ce">LXW_CHART_PATTERN_DIVOT</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da2990d42f2dec7d335bbd53d0396b33b4">LXW_CHART_PATTERN_DOTTED_GRID</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da292c50f4d6e9812bb171c49211b2f5d0">LXW_CHART_PATTERN_DOTTED_DIAMOND</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da533285cbc53748d985e923ff1ccc4650">LXW_CHART_PATTERN_SHINGLE</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da0e511c291add359d48f5b0a1ca833d9b">LXW_CHART_PATTERN_TRELLIS</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da91a25e4f50afc2f5c3b0682e4a826420">LXW_CHART_PATTERN_SPHERE</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da8273b305ea014e11024c5b67c9c34ca0">LXW_CHART_PATTERN_SMALL_GRID</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da96f095cb93bbb612a319db8d8939f2a0">LXW_CHART_PATTERN_LARGE_GRID</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9dae05b9a175dd917ff66adc28b9b3a0e62">LXW_CHART_PATTERN_SMALL_CHECK</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da0d2c5932327db4dd570d8c88b3d63263">LXW_CHART_PATTERN_LARGE_CHECK</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da49fa41a6340d9fb57a75d54dd1a840fc">LXW_CHART_PATTERN_OUTLINED_DIAMOND</a></li>
<li><a class="el" href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da3177756848e745e5c7cd06592faed36d">LXW_CHART_PATTERN_SOLID_DIAMOND</a></li>
</ul>
<dl class="section note"><dt>Note</dt><dd>If a pattern fill is used on a chart object it overrides the solid fill properties of the object.</dd></dl>
<h1><a class="anchor" id="ww_charts_limitations"></a>
Chart Limitations</h1>
<p>The following chart features aren't currently supported in libxlsxwriter but will be in time. See the <a href="https://github.com/jmcnamara/libxlsxwriter/issues">GitHub Chart Feature Requests</a>.</p>
<ul>
<li>Secondary axis.</li>
<li>Combined charts.</li>
<li>Chartsheets.</li>
</ul>
<p>If required these features are all available in the Perl and Python versions of this library.</p>
<p>Next: <a class="el" href="working_with_object_positioning.html">Working with Object Positioning</a> </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<div class="ttc" id="achart_8h_html_ae4653bb0e1bdb5e1e1dbedf52d1c06b5"><div class="ttname"><a href="chart_8h.html#ae4653bb0e1bdb5e1e1dbedf52d1c06b5">chart_series_set_marker_type</a></div><div class="ttdeci">void chart_series_set_marker_type(lxw_chart_series *series, uint8_t type)</div><div class="ttdoc">Set the data marker type for a series.</div></div>
<div class="ttc" id="achart_8h_html_afb0d1b3884f1520c227ef9c8945c2570a913ea1b36ac420c9acf302f6edef768a"><div class="ttname"><a href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570a913ea1b36ac420c9acf302f6edef768a">LXW_CHART_LINE_DASH_LONG_DASH</a></div><div class="ttdeci">@ LXW_CHART_LINE_DASH_LONG_DASH</div><div class="ttdef"><b>Definition:</b> chart.h:218</div></div>
<div class="ttc" id="astructlxw__chart__pattern_html"><div class="ttname"><a href="structlxw__chart__pattern.html">lxw_chart_pattern</a></div><div class="ttdoc">Struct to represent a chart pattern.</div><div class="ttdef"><b>Definition:</b> chart.h:681</div></div>
<div class="ttc" id="achart_8h_html_a9ce06ada55f8341e3e12559c38e5df9d"><div class="ttname"><a href="chart_8h.html#a9ce06ada55f8341e3e12559c38e5df9d">chart_series_set_trendline_equation</a></div><div class="ttdeci">void chart_series_set_trendline_equation(lxw_chart_series *series)</div><div class="ttdoc">Display the equation of a trendline for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_a73af3ba49f013b2a12ecfe15b7ba50c7"><div class="ttname"><a href="chart_8h.html#a73af3ba49f013b2a12ecfe15b7ba50c7">chart_series_set_marker_fill</a></div><div class="ttdeci">void chart_series_set_marker_fill(lxw_chart_series *series, lxw_chart_fill *fill)</div><div class="ttdoc">Set the fill properties for a chart series marker.</div></div>
<div class="ttc" id="aworkbook_8h_html_ad9e7aeebc0fd43562db5bcd527b2ee5e"><div class="ttname"><a href="workbook_8h.html#ad9e7aeebc0fd43562db5bcd527b2ee5e">workbook_close</a></div><div class="ttdeci">lxw_error workbook_close(lxw_workbook *workbook)</div><div class="ttdoc">Close the Workbook object and write the XLSX file.</div></div>
<div class="ttc" id="achart_8h_html_a59b3a386d854b9cb5e8bbdf9eef0c97d"><div class="ttname"><a href="chart_8h.html#a59b3a386d854b9cb5e8bbdf9eef0c97d">chart_series_set_trendline</a></div><div class="ttdeci">void chart_series_set_trendline(lxw_chart_series *series, uint8_t type, uint8_t value)</div><div class="ttdoc">Turn on a trendline for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_a0e27dc551820c1d8d0e06cdd393f4b78"><div class="ttname"><a href="chart_8h.html#a0e27dc551820c1d8d0e06cdd393f4b78">chart_series_set_points</a></div><div class="ttdeci">lxw_error chart_series_set_points(lxw_chart_series *series, lxw_chart_point *points[])</div><div class="ttdoc">Set the formatting for points in the series.</div></div>
<div class="ttc" id="achart_8h_html_adcaf0404fe7cd5c9e49a7b7025c64a35"><div class="ttname"><a href="chart_8h.html#adcaf0404fe7cd5c9e49a7b7025c64a35">chart_series_set_labels_custom</a></div><div class="ttdeci">lxw_error chart_series_set_labels_custom(lxw_chart_series *series, lxw_chart_data_label *data_labels[])</div><div class="ttdoc">Set the properties for data labels in a series.</div></div>
<div class="ttc" id="achart_8h_html_a36f77a797d545b07a656965e4bf2978b"><div class="ttname"><a href="chart_8h.html#a36f77a797d545b07a656965e4bf2978b">chart_series_set_pattern</a></div><div class="ttdeci">void chart_series_set_pattern(lxw_chart_series *series, lxw_chart_pattern *pattern)</div><div class="ttdoc">Set the pattern properties for a chart series.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38ba77f6d9e520849cf6c25a7f33cf303da2"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba77f6d9e520849cf6c25a7f33cf303da2">LXW_COLOR_WHITE</a></div><div class="ttdeci">@ LXW_COLOR_WHITE</div><div class="ttdef"><b>Definition:</b> format.h:223</div></div>
<div class="ttc" id="achart_8h_html_a2775e02cfba1d2b2dc85ebadc03f264da3299a79c3621de0373dac60fdc37f2fa"><div class="ttname"><a href="chart_8h.html#a2775e02cfba1d2b2dc85ebadc03f264da3299a79c3621de0373dac60fdc37f2fa">LXW_CHART_LABEL_SEPARATOR_NEWLINE</a></div><div class="ttdeci">@ LXW_CHART_LABEL_SEPARATOR_NEWLINE</div><div class="ttdef"><b>Definition:</b> chart.h:473</div></div>
<div class="ttc" id="achart_8h_html_ab815412fe8d862efaa8c932df4923178"><div class="ttname"><a href="chart_8h.html#ab815412fe8d862efaa8c932df4923178">chart_series_set_trendline_line</a></div><div class="ttdeci">void chart_series_set_trendline_line(lxw_chart_series *series, lxw_chart_line *line)</div><div class="ttdoc">Set the trendline line properties for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_a401668a7c3f88fad6a6c3631a5620f61"><div class="ttname"><a href="chart_8h.html#a401668a7c3f88fad6a6c3631a5620f61">chart_series_set_trendline_forecast</a></div><div class="ttdeci">void chart_series_set_trendline_forecast(lxw_chart_series *series, double forward, double backward)</div><div class="ttdoc">Set the trendline forecast for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_a2893fbacd275cd67fc0e310ea0101a7fa5d70a912eb58cf4790bbadf8bde2dcdd"><div class="ttname"><a href="chart_8h.html#a2893fbacd275cd67fc0e310ea0101a7fa5d70a912eb58cf4790bbadf8bde2dcdd">LXW_CHART_ERROR_BAR_NO_CAP</a></div><div class="ttdeci">@ LXW_CHART_ERROR_BAR_NO_CAP</div><div class="ttdef"><b>Definition:</b> chart.h:911</div></div>
<div class="ttc" id="achart_8h_html_a0da8f7fad7a0967686a6006a7178c41b"><div class="ttname"><a href="chart_8h.html#a0da8f7fad7a0967686a6006a7178c41b">chart_series_set_labels_legend</a></div><div class="ttdeci">void chart_series_set_labels_legend(lxw_chart_series *series)</div><div class="ttdoc">Set the legend key for a data label in a chart series.</div></div>
<div class="ttc" id="achart_8h_html_a858b96fd44354565fd9019cdb26149fead7300dcc1274164a42e2359a3dfc1465"><div class="ttname"><a href="chart_8h.html#a858b96fd44354565fd9019cdb26149fead7300dcc1274164a42e2359a3dfc1465">LXW_CHART_ERROR_BAR_TYPE_STD_DEV</a></div><div class="ttdeci">@ LXW_CHART_ERROR_BAR_TYPE_STD_DEV</div><div class="ttdef"><b>Definition:</b> chart.h:874</div></div>
<div class="ttc" id="achart_8h_html_a347dc392e6077c1137df42d2ad01edfca0ae3b0b530833d7a3e5315d72467f6ce"><div class="ttname"><a href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca0ae3b0b530833d7a3e5315d72467f6ce">LXW_CHART_MARKER_CIRCLE</a></div><div class="ttdeci">@ LXW_CHART_MARKER_CIRCLE</div><div class="ttdef"><b>Definition:</b> chart.h:265</div></div>
<div class="ttc" id="astructlxw__chart__line_html_ab548d8a04d084df9f14cea072111b052"><div class="ttname"><a href="structlxw__chart__line.html#ab548d8a04d084df9f14cea072111b052">lxw_chart_line::width</a></div><div class="ttdeci">float width</div><div class="ttdef"><b>Definition:</b> chart.h:648</div></div>
<div class="ttc" id="achart_8h_html_aea2957adf1e8c754f771bbcb836229d4"><div class="ttname"><a href="chart_8h.html#aea2957adf1e8c754f771bbcb836229d4">chart_series_set_labels_font</a></div><div class="ttdeci">void chart_series_set_labels_font(lxw_chart_series *series, lxw_chart_font *font)</div><div class="ttdoc">Set the font properties for chart data labels in a series.</div></div>
<div class="ttc" id="achart_8h_html_ac24ae880bab2fa949d8b84a25fc9a457"><div class="ttname"><a href="chart_8h.html#ac24ae880bab2fa949d8b84a25fc9a457">chart_legend_set_font</a></div><div class="ttdeci">void chart_legend_set_font(lxw_chart *chart, lxw_chart_font *font)</div><div class="ttdoc">Set the font properties for a chart legend.</div></div>
<div class="ttc" id="acommon_8h_html_a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4"><div class="ttname"><a href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a847f574cc183a1d8a4e3800fe28091f4">LXW_FALSE</a></div><div class="ttdeci">@ LXW_FALSE</div><div class="ttdef"><b>Definition:</b> common.h:51</div></div>
<div class="ttc" id="achart_8h_html_a9f577b0fcabe6cac9118a26a483fe85ca679756788a8bec4bfc1e1c723ec5246a"><div class="ttname"><a href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85ca679756788a8bec4bfc1e1c723ec5246a">LXW_CHART_PIE</a></div><div class="ttdeci">@ LXW_CHART_PIE</div><div class="ttdef"><b>Definition:</b> chart.h:134</div></div>
<div class="ttc" id="achart_8h_html_a650d569ff37a087101b7bff4ee7bb130"><div class="ttname"><a href="chart_8h.html#a650d569ff37a087101b7bff4ee7bb130">chart_axis_set_name</a></div><div class="ttdeci">void chart_axis_set_name(lxw_chart_axis *axis, const char *name)</div><div class="ttdoc">Set the name caption of the an axis.</div></div>
<div class="ttc" id="achart_8h_html_ac4373346b52a625206c7c04ac3d8dba1ab260b3815f45cbea6ce2b7c0d19157b3"><div class="ttname"><a href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1ab260b3815f45cbea6ce2b7c0d19157b3">LXW_CHART_TRENDLINE_TYPE_AVERAGE</a></div><div class="ttdeci">@ LXW_CHART_TRENDLINE_TYPE_AVERAGE</div><div class="ttdef"><b>Definition:</b> chart.h:947</div></div>
<div class="ttc" id="astructlxw__chart__data__label_html_a084f083e48841fa41d109a4601441460"><div class="ttname"><a href="structlxw__chart__data__label.html#a084f083e48841fa41d109a4601441460">lxw_chart_data_label::value</a></div><div class="ttdeci">char * value</div><div class="ttdef"><b>Definition:</b> chart.h:800</div></div>
<div class="ttc" id="achart_8h_html_ad60de0eb056e93435407e91482115f55"><div class="ttname"><a href="chart_8h.html#ad60de0eb056e93435407e91482115f55">chart_add_series</a></div><div class="ttdeci">lxw_chart_series * chart_add_series(lxw_chart *chart, const char *categories, const char *values)</div><div class="ttdoc">Add a data series to a chart.</div></div>
<div class="ttc" id="achart_8h_html_aa97ba4df6e3cb14bcb773a7c6b55de9daf528922e8775b461b61eb077644c2478"><div class="ttname"><a href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9daf528922e8775b461b61eb077644c2478">LXW_CHART_PATTERN_HORIZONTAL_BRICK</a></div><div class="ttdeci">@ LXW_CHART_PATTERN_HORIZONTAL_BRICK</div><div class="ttdef"><b>Definition:</b> chart.h:379</div></div>
<div class="ttc" id="aworkbook_8h_html_a1cf96608a23ee4eb0e8467c15240d00b"><div class="ttname"><a href="workbook_8h.html#a1cf96608a23ee4eb0e8467c15240d00b">workbook_new</a></div><div class="ttdeci">lxw_workbook * workbook_new(const char *filename)</div><div class="ttdoc">Create a new workbook object.</div></div>
<div class="ttc" id="achart_8h_html_afb0d1b3884f1520c227ef9c8945c2570a2e9fdd36dd3ad7cc2381ce6be26dbc7e"><div class="ttname"><a href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570a2e9fdd36dd3ad7cc2381ce6be26dbc7e">LXW_CHART_LINE_DASH_SQUARE_DOT</a></div><div class="ttdeci">@ LXW_CHART_LINE_DASH_SQUARE_DOT</div><div class="ttdef"><b>Definition:</b> chart.h:209</div></div>
<div class="ttc" id="astructlxw__chart__font_html_a7921a876ed780271df6e0f4bca8e38f5"><div class="ttname"><a href="structlxw__chart__font.html#a7921a876ed780271df6e0f4bca8e38f5">lxw_chart_font::color</a></div><div class="ttdeci">lxw_color_t color</div><div class="ttdef"><b>Definition:</b> chart.h:723</div></div>
<div class="ttc" id="achart_8h_html_a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f"><div class="ttname"><a href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea99f86246aafeee41311ed6681c5b678f">LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</a></div><div class="ttdeci">@ LXW_CHART_ERROR_BAR_TYPE_STD_ERROR</div><div class="ttdef"><b>Definition:</b> chart.h:865</div></div>
<div class="ttc" id="achart_8h_html_ac13170c981b800c64596e4355e87044c"><div class="ttname"><a href="chart_8h.html#ac13170c981b800c64596e4355e87044c">chart_series_set_labels_percentage</a></div><div class="ttdeci">void chart_series_set_labels_percentage(lxw_chart_series *series)</div><div class="ttdoc">Set the percentage for a Pie/Doughnut data point.</div></div>
<div class="ttc" id="achart_8h_html_ab3cde364ea66bb2edfae426299fe7dc7"><div class="ttname"><a href="chart_8h.html#ab3cde364ea66bb2edfae426299fe7dc7">chart_title_set_name_font</a></div><div class="ttdeci">void chart_title_set_name_font(lxw_chart *chart, lxw_chart_font *font)</div><div class="ttdoc">Set the font properties for a chart title.</div></div>
<div class="ttc" id="achart_8h_html_a31b72a8b98d7db92c4cc63e226442d0a"><div class="ttname"><a href="chart_8h.html#a31b72a8b98d7db92c4cc63e226442d0a">chart_series_set_error_bars</a></div><div class="ttdeci">void chart_series_set_error_bars(lxw_series_error_bars *error_bars, uint8_t type, double value)</div></div>
<div class="ttc" id="achart_8h_html_a858b96fd44354565fd9019cdb26149fea49e056be9e39bfca5268ae9eaab11c46"><div class="ttname"><a href="chart_8h.html#a858b96fd44354565fd9019cdb26149fea49e056be9e39bfca5268ae9eaab11c46">LXW_CHART_ERROR_BAR_TYPE_PERCENTAGE</a></div><div class="ttdeci">@ LXW_CHART_ERROR_BAR_TYPE_PERCENTAGE</div><div class="ttdef"><b>Definition:</b> chart.h:871</div></div>
<div class="ttc" id="astructlxw__chart__font_html_ab202b61d5a753874fdd963646e2a0e38"><div class="ttname"><a href="structlxw__chart__font.html#ab202b61d5a753874fdd963646e2a0e38">lxw_chart_font::italic</a></div><div class="ttdeci">uint8_t italic</div><div class="ttdef"><b>Definition:</b> chart.h:711</div></div>
<div class="ttc" id="astructlxw__chart__line_html"><div class="ttname"><a href="structlxw__chart__line.html">lxw_chart_line</a></div><div class="ttdoc">Struct to represent a chart line.</div><div class="ttdef"><b>Definition:</b> chart.h:639</div></div>
<div class="ttc" id="achart_8h_html_a542deffbda8d6be959401c936d821e11"><div class="ttname"><a href="chart_8h.html#a542deffbda8d6be959401c936d821e11">chart_series_set_trendline_intercept</a></div><div class="ttdeci">void chart_series_set_trendline_intercept(lxw_chart_series *series, double intercept)</div><div class="ttdoc">Set the trendline Y-axis intercept for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_a4476eee2a69555f7eac7f716d179fad6"><div class="ttname"><a href="chart_8h.html#a4476eee2a69555f7eac7f716d179fad6">chart_series_set_labels_line</a></div><div class="ttdeci">void chart_series_set_labels_line(lxw_chart_series *series, lxw_chart_line *line)</div><div class="ttdoc">Set the line properties for the data labels in a chart series.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baebda4f169497f225a9c67bb51691c095">LXW_COLOR_YELLOW</a></div><div class="ttdeci">@ LXW_COLOR_YELLOW</div><div class="ttdef"><b>Definition:</b> format.h:226</div></div>
<div class="ttc" id="astructlxw__chart__font_html"><div class="ttname"><a href="structlxw__chart__font.html">lxw_chart_font</a></div><div class="ttdoc">Struct to represent a chart font.</div><div class="ttdef"><b>Definition:</b> chart.h:699</div></div>
<div class="ttc" id="achart_8h_html_a9f577b0fcabe6cac9118a26a483fe85caf309b18af571c90d3ae052e769d30e6c"><div class="ttname"><a href="chart_8h.html#a9f577b0fcabe6cac9118a26a483fe85caf309b18af571c90d3ae052e769d30e6c">LXW_CHART_LINE</a></div><div class="ttdeci">@ LXW_CHART_LINE</div><div class="ttdef"><b>Definition:</b> chart.h:125</div></div>
<div class="ttc" id="astructlxw__worksheet_html"><div class="ttname"><a href="structlxw__worksheet.html">lxw_worksheet</a></div><div class="ttdoc">Struct to represent an Excel worksheet.</div><div class="ttdef"><b>Definition:</b> worksheet.h:1603</div></div>
<div class="ttc" id="achart_8h_html_a416463dd44486e6b6a23209789a3642e"><div class="ttname"><a href="chart_8h.html#a416463dd44486e6b6a23209789a3642e">chart_series_set_marker_line</a></div><div class="ttdeci">void chart_series_set_marker_line(lxw_chart_series *series, lxw_chart_line *line)</div><div class="ttdoc">Set the line properties for a chart series marker.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba13bdb1312b42e892cd29dfeb79ec8451">LXW_COLOR_BLACK</a></div><div class="ttdeci">@ LXW_COLOR_BLACK</div><div class="ttdef"><b>Definition:</b> format.h:181</div></div>
<div class="ttc" id="astructlxw__chart__data__label_html"><div class="ttname"><a href="structlxw__chart__data__label.html">lxw_chart_data_label</a></div><div class="ttdoc">Struct to represent an Excel chart data label.</div><div class="ttdef"><b>Definition:</b> chart.h:796</div></div>
<div class="ttc" id="achart_8h_html_a97496720a6c6c9d0c82cf4f26bf71ae0"><div class="ttname"><a href="chart_8h.html#a97496720a6c6c9d0c82cf4f26bf71ae0">chart_series_set_error_bars_line</a></div><div class="ttdeci">void chart_series_set_error_bars_line(lxw_series_error_bars *error_bars, lxw_chart_line *line)</div><div class="ttdoc">Set the line properties for a chart series error bars.</div></div>
<div class="ttc" id="achart_8h_html_a3da2fd3d4dd9d223251584494a946cb7"><div class="ttname"><a href="chart_8h.html#a3da2fd3d4dd9d223251584494a946cb7">chart_series_set_trendline_name</a></div><div class="ttdeci">void chart_series_set_trendline_name(lxw_chart_series *series, const char *name)</div><div class="ttdoc">Set the trendline name for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_ac4be8325cbcaeddda0a92f1809d8156d"><div class="ttname"><a href="chart_8h.html#ac4be8325cbcaeddda0a92f1809d8156d">chart_axis_set_name_font</a></div><div class="ttdeci">void chart_axis_set_name_font(lxw_chart_axis *axis, lxw_chart_font *font)</div><div class="ttdoc">Set the font properties for a chart axis name.</div></div>
<div class="ttc" id="achart_8h_html_afb0d1b3884f1520c227ef9c8945c2570ae5fefc31566d4ac3f9268a37e7629911"><div class="ttname"><a href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570ae5fefc31566d4ac3f9268a37e7629911">LXW_CHART_LINE_DASH_DASH_DOT</a></div><div class="ttdeci">@ LXW_CHART_LINE_DASH_DASH_DOT</div><div class="ttdef"><b>Definition:</b> chart.h:215</div></div>
<div class="ttc" id="astructlxw__chart__point_html_a99ad02687c88e7ac4625fa8c12f6ba48"><div class="ttname"><a href="structlxw__chart__point.html#a99ad02687c88e7ac4625fa8c12f6ba48">lxw_chart_point::fill</a></div><div class="ttdeci">lxw_chart_fill * fill</div><div class="ttdef"><b>Definition:</b> chart.h:783</div></div>
<div class="ttc" id="acommon_8h_html_a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf"><div class="ttname"><a href="common_8h.html#a57bffaf0ff3cb4e9f4f7f2b0b6dad349a7850bcc34c18efe2e45372f4069be0bf">LXW_TRUE</a></div><div class="ttdeci">@ LXW_TRUE</div><div class="ttdef"><b>Definition:</b> common.h:53</div></div>
<div class="ttc" id="achart_8h_html_ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e"><div class="ttname"><a href="chart_8h.html#ac4373346b52a625206c7c04ac3d8dba1a412a1b24bf43c9de3b2c0445d8e8e93e">LXW_CHART_TRENDLINE_TYPE_LINEAR</a></div><div class="ttdeci">@ LXW_CHART_TRENDLINE_TYPE_LINEAR</div><div class="ttdef"><b>Definition:</b> chart.h:932</div></div>
<div class="ttc" id="astructlxw__chart_html"><div class="ttname"><a href="structlxw__chart.html">lxw_chart</a></div><div class="ttdoc">Struct to represent an Excel chart.</div><div class="ttdef"><b>Definition:</b> chart.h:1086</div></div>
<div class="ttc" id="aworksheet_8h_html_ac2067faaacb8bfa6550b019e915900a2"><div class="ttname"><a href="worksheet_8h.html#ac2067faaacb8bfa6550b019e915900a2">worksheet_insert_chart</a></div><div class="ttdeci">lxw_error worksheet_insert_chart(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, lxw_chart *chart)</div><div class="ttdoc">Insert a chart object into a worksheet.</div></div>
<div class="ttc" id="astructlxw__chart__series_html"><div class="ttname"><a href="structlxw__chart__series.html">lxw_chart_series</a></div><div class="ttdoc">Struct to represent an Excel chart data series.</div><div class="ttdef"><b>Definition:</b> chart.h:957</div></div>
<div class="ttc" id="astructlxw__chart__line_html_a0f3901f6d5faa3a8fa8057a56ded89de"><div class="ttname"><a href="structlxw__chart__line.html#a0f3901f6d5faa3a8fa8057a56ded89de">lxw_chart_line::dash_type</a></div><div class="ttdeci">uint8_t dash_type</div><div class="ttdef"><b>Definition:</b> chart.h:651</div></div>
<div class="ttc" id="astructlxw__chart__fill_html_a1780f71f3de68cb03e2f2825952283e4"><div class="ttname"><a href="structlxw__chart__fill.html#a1780f71f3de68cb03e2f2825952283e4">lxw_chart_fill::color</a></div><div class="ttdeci">lxw_color_t color</div><div class="ttdef"><b>Definition:</b> chart.h:666</div></div>
<div class="ttc" id="achart_8h_html_a1128d0e553fc350134c4937a19cfe430af5e0e1d7fda566367f65c52f793a25c8"><div class="ttname"><a href="chart_8h.html#a1128d0e553fc350134c4937a19cfe430af5e0e1d7fda566367f65c52f793a25c8">LXW_CHART_LABEL_POSITION_ABOVE</a></div><div class="ttdeci">@ LXW_CHART_LABEL_POSITION_ABOVE</div><div class="ttdef"><b>Definition:</b> chart.h:441</div></div>
<div class="ttc" id="achart_8h_html_ab03b0a4da953fa6bb47e2296b82476d2"><div class="ttname"><a href="chart_8h.html#ab03b0a4da953fa6bb47e2296b82476d2">chart_series_set_error_bars_endcap</a></div><div class="ttdeci">void chart_series_set_error_bars_endcap(lxw_series_error_bars *error_bars, uint8_t endcap)</div><div class="ttdoc">Set the end cap type for the error bars of a chart series.</div></div>
<div class="ttc" id="achart_8h_html_a9f90731ea7f0ff224a19315604ce2acb"><div class="ttname"><a href="chart_8h.html#a9f90731ea7f0ff224a19315604ce2acb">chart_series_set_marker_size</a></div><div class="ttdeci">void chart_series_set_marker_size(lxw_chart_series *series, uint8_t size)</div><div class="ttdoc">Set the size of a data marker for a series.</div></div>
<div class="ttc" id="astructlxw__chart__line_html_a651a52de6b66e19d5a43ee0c219502b2"><div class="ttname"><a href="structlxw__chart__line.html#a651a52de6b66e19d5a43ee0c219502b2">lxw_chart_line::none</a></div><div class="ttdeci">uint8_t none</div><div class="ttdef"><b>Definition:</b> chart.h:645</div></div>
<div class="ttc" id="astructlxw__chart_html_aec951bda729ea8184fa0827c5f091f37"><div class="ttname"><a href="structlxw__chart.html#aec951bda729ea8184fa0827c5f091f37">lxw_chart::y_axis</a></div><div class="ttdeci">lxw_chart_axis * y_axis</div><div class="ttdef"><b>Definition:</b> chart.h:1107</div></div>
<div class="ttc" id="achart_8h_html_a347dc392e6077c1137df42d2ad01edfca06f870f503d97d50c1177e526208f699"><div class="ttname"><a href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca06f870f503d97d50c1177e526208f699">LXW_CHART_MARKER_DIAMOND</a></div><div class="ttdeci">@ LXW_CHART_MARKER_DIAMOND</div><div class="ttdef"><b>Definition:</b> chart.h:247</div></div>
<div class="ttc" id="achart_8h_html_aa897ee54d4a19f264a6b8f9dd43604b3"><div class="ttname"><a href="chart_8h.html#aa897ee54d4a19f264a6b8f9dd43604b3">chart_series_set_error_bars_direction</a></div><div class="ttdeci">void chart_series_set_error_bars_direction(lxw_series_error_bars *error_bars, uint8_t direction)</div><div class="ttdoc">Set the direction (up, down or both) of the error bars for a chart series.</div></div>
<div class="ttc" id="achart_8h_html_a6f4baebf02df517d55a5d1447e3511cd"><div class="ttname"><a href="chart_8h.html#a6f4baebf02df517d55a5d1447e3511cd">chart_series_set_labels_position</a></div><div class="ttdeci">void chart_series_set_labels_position(lxw_chart_series *series, uint8_t position)</div><div class="ttdoc">Set the data label position for a series.</div></div>
<div class="ttc" id="achart_8h_html_ac22638faf2a6168d23af1969fcaa0612"><div class="ttname"><a href="chart_8h.html#ac22638faf2a6168d23af1969fcaa0612">chart_legend_delete_series</a></div><div class="ttdeci">lxw_error chart_legend_delete_series(lxw_chart *chart, int16_t delete_series[])</div><div class="ttdoc">Remove one or more series from the the legend.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38bae0b5c39ced3b8c871974f0e4917e4871">LXW_COLOR_GREEN</a></div><div class="ttdeci">@ LXW_COLOR_GREEN</div><div class="ttdef"><b>Definition:</b> format.h:196</div></div>
<div class="ttc" id="achart_8h_html_ac8f7f044cc9d893568e9d4c9fcf13aa9"><div class="ttname"><a href="chart_8h.html#ac8f7f044cc9d893568e9d4c9fcf13aa9">chart_series_set_labels</a></div><div class="ttdeci">void chart_series_set_labels(lxw_chart_series *series)</div><div class="ttdoc">Add data labels to a chart series.</div></div>
<div class="ttc" id="astructlxw__chart__fill_html"><div class="ttname"><a href="structlxw__chart__fill.html">lxw_chart_fill</a></div><div class="ttdoc">Struct to represent a chart fill.</div><div class="ttdef"><b>Definition:</b> chart.h:663</div></div>
<div class="ttc" id="achart_8h_html_a85cee89620705cec1c3f705d30ce5fe5"><div class="ttname"><a href="chart_8h.html#a85cee89620705cec1c3f705d30ce5fe5">chart_series_set_trendline_r_squared</a></div><div class="ttdeci">void chart_series_set_trendline_r_squared(lxw_chart_series *series)</div><div class="ttdoc">Display the R squared value of a trendline for a chart data series.</div></div>
<div class="ttc" id="achart_8h_html_afb0d1b3884f1520c227ef9c8945c2570ac86d05550348d57f941c2a4c6e55d4e2"><div class="ttname"><a href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570ac86d05550348d57f941c2a4c6e55d4e2">LXW_CHART_LINE_DASH_SOLID</a></div><div class="ttdeci">@ LXW_CHART_LINE_DASH_SOLID</div><div class="ttdef"><b>Definition:</b> chart.h:203</div></div>
<div class="ttc" id="achart_8h_html_a347dc392e6077c1137df42d2ad01edfca3575e2c5d289739b8c5b825c13893ff7"><div class="ttname"><a href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca3575e2c5d289739b8c5b825c13893ff7">LXW_CHART_MARKER_AUTOMATIC</a></div><div class="ttdeci">@ LXW_CHART_MARKER_AUTOMATIC</div><div class="ttdef"><b>Definition:</b> chart.h:238</div></div>
<div class="ttc" id="achart_8h_html_a35e370165e50f5e053ccdc96ed933e66"><div class="ttname"><a href="chart_8h.html#a35e370165e50f5e053ccdc96ed933e66">chart_series_set_labels_separator</a></div><div class="ttdeci">void chart_series_set_labels_separator(lxw_chart_series *series, uint8_t separator)</div><div class="ttdoc">Set the separator for the data label captions.</div></div>
<div class="ttc" id="astructlxw__chart__font_html_a9d9fc7673d551efbe2a9729f211c25c4"><div class="ttname"><a href="structlxw__chart__font.html#a9d9fc7673d551efbe2a9729f211c25c4">lxw_chart_font::name</a></div><div class="ttdeci">char * name</div><div class="ttdef"><b>Definition:</b> chart.h:702</div></div>
<div class="ttc" id="astructlxw__chart__line_html_a2619e85b4ece41f55302b5bc8157d738"><div class="ttname"><a href="structlxw__chart__line.html#a2619e85b4ece41f55302b5bc8157d738">lxw_chart_line::color</a></div><div class="ttdeci">lxw_color_t color</div><div class="ttdef"><b>Definition:</b> chart.h:642</div></div>
<div class="ttc" id="astructlxw__workbook_html"><div class="ttname"><a href="structlxw__workbook.html">lxw_workbook</a></div><div class="ttdoc">Struct to represent an Excel workbook.</div><div class="ttdef"><b>Definition:</b> workbook.h:273</div></div>
<div class="ttc" id="astructlxw__chart_html_a17fa7931e6825a60de50444438e7f718"><div class="ttname"><a href="structlxw__chart.html#a17fa7931e6825a60de50444438e7f718">lxw_chart::x_axis</a></div><div class="ttdeci">lxw_chart_axis * x_axis</div><div class="ttdef"><b>Definition:</b> chart.h:1101</div></div>
<div class="ttc" id="achart_8h_html_a6f1d7cd452a4a3f87046468ce5588bfd"><div class="ttname"><a href="chart_8h.html#a6f1d7cd452a4a3f87046468ce5588bfd">chart_series_set_fill</a></div><div class="ttdeci">void chart_series_set_fill(lxw_chart_series *series, lxw_chart_fill *fill)</div><div class="ttdoc">Set the fill properties for a chart series.</div></div>
<div class="ttc" id="astructlxw__chart__font_html_a6ed9b251728efcaf0e8ee460377ab17f"><div class="ttname"><a href="structlxw__chart__font.html#a6ed9b251728efcaf0e8ee460377ab17f">lxw_chart_font::rotation</a></div><div class="ttdeci">int32_t rotation</div><div class="ttdef"><b>Definition:</b> chart.h:720</div></div>
<div class="ttc" id="astructlxw__chart__fill_html_a97c6c00984b20f692af6b6c1ac2cc3b4"><div class="ttname"><a href="structlxw__chart__fill.html#a97c6c00984b20f692af6b6c1ac2cc3b4">lxw_chart_fill::none</a></div><div class="ttdeci">uint8_t none</div><div class="ttdef"><b>Definition:</b> chart.h:669</div></div>
<div class="ttc" id="achart_8h_html_af1382251c31fd8f97e19048acf5db0a1"><div class="ttname"><a href="chart_8h.html#af1382251c31fd8f97e19048acf5db0a1">chart_legend_set_position</a></div><div class="ttdeci">void chart_legend_set_position(lxw_chart *chart, uint8_t position)</div><div class="ttdoc">Set the position of the chart legend.</div></div>
<div class="ttc" id="achart_8h_html_a858b96fd44354565fd9019cdb26149feaba45d9e553700f3f1a3df0c1f80259c0"><div class="ttname"><a href="chart_8h.html#a858b96fd44354565fd9019cdb26149feaba45d9e553700f3f1a3df0c1f80259c0">LXW_CHART_ERROR_BAR_TYPE_FIXED</a></div><div class="ttdeci">@ LXW_CHART_ERROR_BAR_TYPE_FIXED</div><div class="ttdef"><b>Definition:</b> chart.h:868</div></div>
<div class="ttc" id="achart_8h_html_aa97ba4df6e3cb14bcb773a7c6b55de9da533285cbc53748d985e923ff1ccc4650"><div class="ttname"><a href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da533285cbc53748d985e923ff1ccc4650">LXW_CHART_PATTERN_SHINGLE</a></div><div class="ttdeci">@ LXW_CHART_PATTERN_SHINGLE</div><div class="ttdef"><b>Definition:</b> chart.h:397</div></div>
<div class="ttc" id="achart_8h_html_aede723351fb3f426cd0ef2b891fc6726"><div class="ttname"><a href="chart_8h.html#aede723351fb3f426cd0ef2b891fc6726">chart_series_set_labels_options</a></div><div class="ttdeci">void chart_series_set_labels_options(lxw_chart_series *series, uint8_t show_name, uint8_t show_category, uint8_t show_value)</div><div class="ttdoc">Set the display options for the labels of a data series.</div></div>
<div class="ttc" id="achart_8h_html_aa0a0b3eadc51a608c76bb9473943e191"><div class="ttname"><a href="chart_8h.html#aa0a0b3eadc51a608c76bb9473943e191">chart_title_set_name</a></div><div class="ttdeci">void chart_title_set_name(lxw_chart *chart, const char *name)</div><div class="ttdoc">Set the title of the chart.</div></div>
<div class="ttc" id="achart_8h_html_a4d10632ee4bcc139359094042a8c411f"><div class="ttname"><a href="chart_8h.html#a4d10632ee4bcc139359094042a8c411f">chart_series_set_line</a></div><div class="ttdeci">void chart_series_set_line(lxw_chart_series *series, lxw_chart_line *line)</div><div class="ttdoc">Set the line properties for a chart series.</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38ba81f6ca72c0925fe665263547614ebb37">LXW_COLOR_BLUE</a></div><div class="ttdeci">@ LXW_COLOR_BLUE</div><div class="ttdef"><b>Definition:</b> format.h:184</div></div>
<div class="ttc" id="astructlxw__chart__font_html_abca1be9b66dcd9bc4558cc97556456b5"><div class="ttname"><a href="structlxw__chart__font.html#abca1be9b66dcd9bc4558cc97556456b5">lxw_chart_font::bold</a></div><div class="ttdeci">uint8_t bold</div><div class="ttdef"><b>Definition:</b> chart.h:708</div></div>
<div class="ttc" id="aworksheet_8h_html_ac208046e7a6d12cc87982422efa41b31"><div class="ttname"><a href="worksheet_8h.html#ac208046e7a6d12cc87982422efa41b31">worksheet_write_string</a></div><div class="ttdeci">lxw_error worksheet_write_string(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, const char *string, lxw_format *format)</div><div class="ttdoc">Write a string to a worksheet cell.</div></div>
<div class="ttc" id="achart_8h_html_aa97ba4df6e3cb14bcb773a7c6b55de9da5a62210a0468e996272d93cbf1cb9209"><div class="ttname"><a href="chart_8h.html#aa97ba4df6e3cb14bcb773a7c6b55de9da5a62210a0468e996272d93cbf1cb9209">LXW_CHART_PATTERN_NONE</a></div><div class="ttdeci">@ LXW_CHART_PATTERN_NONE</div><div class="ttdef"><b>Definition:</b> chart.h:277</div></div>
<div class="ttc" id="aformat_8h_html_abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec"><div class="ttname"><a href="format_8h.html#abeafc6e8222ba9fcfd4f2c2f4e9ea38baedd7412491d9f34fc5f947ada9d196ec">LXW_COLOR_RED</a></div><div class="ttdeci">@ LXW_COLOR_RED</div><div class="ttdef"><b>Definition:</b> format.h:217</div></div>
<div class="ttc" id="aworksheet_8h_html_ad9fc47d3beaa2ab4759414e8580c2289"><div class="ttname"><a href="worksheet_8h.html#ad9fc47d3beaa2ab4759414e8580c2289">worksheet_write_number</a></div><div class="ttdeci">lxw_error worksheet_write_number(lxw_worksheet *worksheet, lxw_row_t row, lxw_col_t col, double number, lxw_format *format)</div><div class="ttdoc">Write a number to a worksheet cell.</div></div>
<div class="ttc" id="achart_8h_html_a347dc392e6077c1137df42d2ad01edfca8034b60b42094dd1a919e1432828b9ce"><div class="ttname"><a href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfca8034b60b42094dd1a919e1432828b9ce">LXW_CHART_MARKER_NONE</a></div><div class="ttdeci">@ LXW_CHART_MARKER_NONE</div><div class="ttdef"><b>Definition:</b> chart.h:241</div></div>
<div class="ttc" id="astructlxw__chart__data__label_html_a4cd68183846a54e6fa95edc8ba873ec9"><div class="ttname"><a href="structlxw__chart__data__label.html#a4cd68183846a54e6fa95edc8ba873ec9">lxw_chart_data_label::hide</a></div><div class="ttdeci">uint8_t hide</div><div class="ttdef"><b>Definition:</b> chart.h:804</div></div>
<div class="ttc" id="achart_8h_html_afb0d1b3884f1520c227ef9c8945c2570a0b8b0397fefbaef241d5e99153a7a9ff"><div class="ttname"><a href="chart_8h.html#afb0d1b3884f1520c227ef9c8945c2570a0b8b0397fefbaef241d5e99153a7a9ff">LXW_CHART_LINE_DASH_ROUND_DOT</a></div><div class="ttdeci">@ LXW_CHART_LINE_DASH_ROUND_DOT</div><div class="ttdef"><b>Definition:</b> chart.h:206</div></div>
<div class="ttc" id="achart_8h_html_a5416ddeb493de3e78245d77d0af8a66ea359a4cea90dabfa009eeb80d2bde5a14"><div class="ttname"><a href="chart_8h.html#a5416ddeb493de3e78245d77d0af8a66ea359a4cea90dabfa009eeb80d2bde5a14">LXW_CHART_ERROR_BAR_DIR_PLUS</a></div><div class="ttdeci">@ LXW_CHART_ERROR_BAR_DIR_PLUS</div><div class="ttdef"><b>Definition:</b> chart.h:886</div></div>
<div class="ttc" id="astructlxw__chart__font_html_a13fce73724d63f5f2ab70a1abf64f758"><div class="ttname"><a href="structlxw__chart__font.html#a13fce73724d63f5f2ab70a1abf64f758">lxw_chart_font::underline</a></div><div class="ttdeci">uint8_t underline</div><div class="ttdef"><b>Definition:</b> chart.h:714</div></div>
<div class="ttc" id="astructlxw__chart__pattern_html_ad89b0a7ee149372b44b42519d9ae6d80"><div class="ttname"><a href="structlxw__chart__pattern.html#ad89b0a7ee149372b44b42519d9ae6d80">lxw_chart_pattern::type</a></div><div class="ttdeci">uint8_t type</div><div class="ttdef"><b>Definition:</b> chart.h:690</div></div>
<div class="ttc" id="achart_8h_html_aa7331d5134989542f324aa6f1f1f7d22ad8ecb14a4843e242f037b00c8d28c8ec"><div class="ttname"><a href="chart_8h.html#aa7331d5134989542f324aa6f1f1f7d22ad8ecb14a4843e242f037b00c8d28c8ec">LXW_CHART_LEGEND_BOTTOM</a></div><div class="ttdeci">@ LXW_CHART_LEGEND_BOTTOM</div><div class="ttdef"><b>Definition:</b> chart.h:179</div></div>
<div class="ttc" id="achart_8h_html_aaaf55fefef465fee308c5fe5be44674b"><div class="ttname"><a href="chart_8h.html#aaaf55fefef465fee308c5fe5be44674b">chart_series_set_labels_num_format</a></div><div class="ttdeci">void chart_series_set_labels_num_format(lxw_chart_series *series, const char *num_format)</div><div class="ttdoc">Set the number format for chart data labels in a series.</div></div>
<div class="ttc" id="astructlxw__chart__point_html"><div class="ttname"><a href="structlxw__chart__point.html">lxw_chart_point</a></div><div class="ttdoc">Struct to represent an Excel chart data point.</div><div class="ttdef"><b>Definition:</b> chart.h:777</div></div>
<div class="ttc" id="achart_8h_html_ab81a050644bc887512b435b1022950aa"><div class="ttname"><a href="chart_8h.html#ab81a050644bc887512b435b1022950aa">chart_series_set_labels_leader_line</a></div><div class="ttdeci">void chart_series_set_labels_leader_line(lxw_chart_series *series)</div><div class="ttdoc">Set leader lines for Pie and Doughnut charts.</div></div>
<div class="ttc" id="autility_8h_html_ad510ac6df573d23203374e24dba373d2"><div class="ttname"><a href="utility_8h.html#ad510ac6df573d23203374e24dba373d2">CELL</a></div><div class="ttdeci">#define CELL(cell)</div><div class="ttdoc">Convert an Excel A1 cell string into a (row, col) pair.</div><div class="ttdef"><b>Definition:</b> utility.h:45</div></div>
<div class="ttc" id="achart_8h_html_a347dc392e6077c1137df42d2ad01edfcac09f924f33e8068a175686cd968332a1"><div class="ttname"><a href="chart_8h.html#a347dc392e6077c1137df42d2ad01edfcac09f924f33e8068a175686cd968332a1">LXW_CHART_MARKER_SQUARE</a></div><div class="ttdeci">@ LXW_CHART_MARKER_SQUARE</div><div class="ttdef"><b>Definition:</b> chart.h:244</div></div>
<div class="ttc" id="aworkbook_8h_html_a81d456b4f65a464e78e4a0030ecc3c2e"><div class="ttname"><a href="workbook_8h.html#a81d456b4f65a464e78e4a0030ecc3c2e">workbook_add_worksheet</a></div><div class="ttdeci">lxw_worksheet * workbook_add_worksheet(lxw_workbook *workbook, const char *sheetname)</div><div class="ttdoc">Add a new worksheet to a workbook.</div></div>
<div class="ttc" id="aworkbook_8h_html_a63b001ecefdbc4417986a3e344657726"><div class="ttname"><a href="workbook_8h.html#a63b001ecefdbc4417986a3e344657726">workbook_add_chart</a></div><div class="ttdeci">lxw_chart * workbook_add_chart(lxw_workbook *workbook, uint8_t chart_type)</div><div class="ttdoc">Create a new chart to be added to a worksheet:</div></div>
<div class="ttc" id="achart_8h_html_a01f1ac1674089e0dc219dc3214b911c4"><div class="ttname"><a href="chart_8h.html#a01f1ac1674089e0dc219dc3214b911c4">chart_axis_set_num_font</a></div><div class="ttdeci">void chart_axis_set_num_font(lxw_chart_axis *axis, lxw_chart_font *font)</div><div class="ttdoc">Set the font properties for the numbers of a chart axis.</div></div>
<div class="ttc" id="achart_8h_html_add8ab9f6f62a3de270b8d17bd2748217"><div class="ttname"><a href="chart_8h.html#add8ab9f6f62a3de270b8d17bd2748217">chart_series_set_labels_fill</a></div><div class="ttdeci">void chart_series_set_labels_fill(lxw_chart_series *series, lxw_chart_fill *fill)</div><div class="ttdoc">Set the fill properties for the data labels in a chart series.</div></div>
<!-- HTML footer for doxygen 1.8.20-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Copyright 2014-2020 John McNamara.
Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
</small></address>
</body>
</html>
